Can someone help me why it doesn\'t work?
I have a checkbox
and if I click on it,
this should uncheck all the checkbox inside the datagridview which were check
You can use this code on your grid CellClick event for check or unchecked cell checkbox :
private void Grid_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 0)
{
Grid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = (Grid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value == null ? true : (!(bool)Grid.Rows[e.RowIndex].Cells[e.ColumnIndex].Value));
}
}