Datagridview cellvalidating old value
You might want to handle this for a number of reasons: to enable a save button, to change the appearance of selected items, to display a pop-up window, or to check for consistency against other choices.It turns out that this is trickier than it might seem and doesn’t work great out of the box from .
It’s important to note that this event will get called twice, once on changing the state of the cell to dirty (before committing changes) and once when changing the cell state back to ‘clean’ (after the changes have been committed).
NET, but, not to fear, there are several easy work-arounds that will get the trick done.
When you click a Check Box in a Data Grid View Check Box Column, the check marker will update immediately, but Cell Value Changed event on the Data Grid View will not fire until the user happens to click elsewhere and the cell has lost focus. Well, the Data Grid View thinks it’s a little preemptive to go declaring that the cell value has changed while you are still selected on it.
1) Add a conditional statement in the event handler code to only execute when required.
2) Detach the event hander before the unwanted event triggers and re-attach after.
How can I disable the cell validating event for the rows that was added before???