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
Simple code for you it will work
private void dgv_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (dgv.CurrentRow.Cells["ColumnNumber"].Value != null && (bool)dgv.CurrentRow.Cells["ColumnNumber"].Value)
{
dgv.CurrentRow.Cells["ColumnNumber"].Value = false;
dgv.CurrentRow.Cells["ColumnNumber"].Value = null;
}
else if (dgv.CurrentRow.Cells["ColumnNumber"].Value == null )
{
dgv.CurrentRow.Cells["ColumnNumber"].Value = true;
}
}