I have validation logic in the RowValidating event of a DataGridView. However, when a user clicks on a cell in a different row, it never triggers the RowValidating event from the row that was left. I don't really object to the moving to another row, I just want the original row to be validated!
The event triggers properly if a keystroke causes the row to change, but clicking another row with the mouse does not trigger the event. Is there a way to get the event to fire when the user clicks on another row?
What I have tried:
I've tried putting code in the RowLeave event to test if the row's been validated, but there doesn't seem to be anything to detect that. Also, I need the validation code to allow cancellation, so I cannot just put the validation code in RowLeave.