for (int i = 0; i < dataGridView1.Rows.Count; i++)
{
//判断当前行是否被选中
if ((bool)dataGridView1.Rows[i].Cells[0].EditedFormattedValue == true)
//设置每一行的选择框为未选中
dataGridView1.Rows[i].Cells[0].Value = false;
else
//设置每一行的选择框为选中
dataGridView1.Rows[i].Cells[0].Value = true;
}
C#WINFROM 选中全部
最新推荐文章于 2024-04-21 17:52:12 发布