When a check box of
DataGridView
is clicked, it will be in dirty state and when another cell or row is clicked the data will be committed. In your case when you click the check box and do not click elsewhere then the CurrentCell will be in dirty state. Handle the following event as shown below to commit the data
void dataGridView1_CurrentCellDirtyStateChanged(object sender,
EventArgs e)
{
if (dataGridView1.CurrentCell.ColumnIndex== 1 && dataGridView1.IsCurrentCellDirty)
{
dataGridView1.CommitEdit(DataGridViewDataErrorContexts.Commit);
}
}
You may accept and vote solution if your problem is solved, otherwise post your queries.