devexpress gridcontrol如何遍历每一行

List<Medicine> medicinelist = new List<Medicine>();

foreach (GridViewRow row in GridView1.Rows)
{
if (row.Cells[0].Value != null && (bool)row.Cells[0].Value == true)
{
Medicine medicine = new Medicine();
medicine.Hiscode = row.Cells[1].FormattedValue.ToString();
medicine.Hisname = row.Cells[2].FormattedValue.ToString();
medicine.Hisscalctype = row.Cells[3].FormattedValue.ToString();
medicine.Hisspec = row.Cells[4].FormattedValue.ToString();
medicine.Hisunits = row.Cells[5].FormattedValue.ToString();
medicine.IsMedTre = true;
medicinelist.Add(medicine);
}
}

 

posted @ 2018-05-09 22:49  一念如是  阅读(4821)  评论(2编辑  收藏  举报