List<Medicine> medicinelist = new List<Medicine>();
foreach (DataGridViewRow row in this.gridControl1)
{
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);
}
}
红色划线部分该怎么写
foreach ( GridViewRow row in GridView1.Rows)
{
}