for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
DataGridViewCheckBoxCell cb = (DataGridViewCheckBoxCell)this.dataGridView1.Rows[i].Cells[0];
bool flag = Convert.ToBoolean(cb.Value);
if (flag==true)
{
this.dataGridView1.Rows[i].Selected = true;
index.Add(i);
}
}
C#Winform判断DataGridView中的checkbox列是否选中
本文转载:CSDN博客