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);
                }
            }


本文转载:CSDN博客