请问,C#里DataGridView控件上添加CheckBox不能全部选中,该怎么解决?

2024-08-10 03:49:56
推荐回答(2个)
回答1:

全选或取消时判断一下是昌弯否闷掘选耐罩闷中:
for (int i = 0; i < this.dataGridView1.Rows.Count; i++)
{
if ((bool)dataGridView1.Rows[i].Cells["mark"].EditedFormattedValue==true)
{
this.dataGridView1.Rows[i].Cells["mark"].Value = false;
}
}

回答2:

通过js 来全部选中