The example below contain grid of CheckBoxColumn and an TextBoxColumn that contain an ID.
List
DataGridViewRow row;
DataGridViewCheckBoxCell cell;
for (int i = 0; i < this.chkModuleList.Rows.Count;i++ )//Loop all grid rows
{
row = this.chkModuleList.Rows[i];
cell = row.Cells["chkAddThisModule"] as DataGridViewCheckBoxCell;
if ((null != cell && null != cell.Value && true == (bool)cell.Value))//If checkbox == true
{
lstIdModuleToAdd.Add(Convert.ToInt32(row.Cells["Id"].Value));
}
}
1 comment:
Smiling is definitely one of the best beauty remedies. If you have a good sense of humor and a good approach to life, that's beautiful. See the link below for more info.
#approach
www.ufgop.org
Post a Comment