To resolve your problem, you need to know how CommitEdit method and CellValueChanged event work.
1. Before you click the CheckBox in the cell, the dataGridView1.IsCurrentCellDirty property is False.
2. When you click the CheckBox, dataGridView1.IsCurrentCellDirty property becomes True, so the CurrentCellDirtyStateChanged event is called.
3. In the CurrentCellDirtyStateChanged event, you call CommitEdit method.
And you need to take notice that in CommitEdit method CellValueChanged event will be called.
4. After CellValueChanged event is called, the dataGridView1.IsCurrentCellDirty property becomes False. So the CurrentCellDirtyStateChanged event will be called again.
But at this time, you also need to take notice that the previous CommitEdit method is not finished yet.
5. After the second CurrentCellDirtyStateChanged event is called, it'll return back to the previous CommitEdit method.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
HERE to participate the survey.