The following code will do the check for you:
int index = dataGridView1.Rows.Count - 1;
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if (row.Index < index) // You don't want to check the unbound row at the bottom
{
if (row.Cells["Column1"].Valu
{
if ((bool)row.Cells["Column1"
{
MessageBox.Show("row " + row.Index + " is checked");
}
}
}
}
Main Topics
Browse All Topics





by: sksJegadeeshPosted on 2009-09-21 at 21:52:59ID: 25389563
When you want to check the checkboxes to be checked or not. You can handle the bulk event in Item_Command event.