双击DataGridView进入事件

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            int count = dataGridView1.Rows.Count;
            for (int i = 0; i < count; i++)
            {
                DataGridViewCheckBoxCell checkCell = (DataGridViewCheckBoxCell)dataGridView1.Rows[i].Cells[0];
                Boolean flag = Convert.ToBoolean(checkCell.Value);
                if (flag == true)
                {
                    checkCell.Value = false;
                }
                else
                {
                    continue;
                }
            }

        }

 

 posted on 2016-10-27 12:03  布鲁布鲁sky  阅读(1769)  评论(0编辑  收藏  举报