private void totalDataGridView1_CellContentClick_1(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == -1 || e.RowIndex == -1) return;
for (int i = 0; i < totalDataGridView1.DataGrid.Rows.Count; i++)
{
DataGridViewCheckBoxCell checkcell = (DataGridViewCheckBoxCell)totalDataGridView1.DataGrid.Rows[i].Cells[0];
checkcell.Value = false;
}
DataGridViewCheckBoxCell ifcheck = (DataGridViewCheckBoxCell)totalDataGridView1.DataGrid.Rows[e.RowIndex].Cells[0];
ifcheck.Value = true;
}
{
if (e.ColumnIndex == -1 || e.RowIndex == -1) return;
for (int i = 0; i < totalDataGridView1.DataGrid.Rows.Count; i++)
{
DataGridViewCheckBoxCell checkcell = (DataGridViewCheckBoxCell)totalDataGridView1.DataGrid.Rows[i].Cells[0];
checkcell.Value = false;
}
DataGridViewCheckBoxCell ifcheck = (DataGridViewCheckBoxCell)totalDataGridView1.DataGrid.Rows[e.RowIndex].Cells[0];
ifcheck.Value = true;
}
版权声明:本文为zhoukk1985原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。