Extreme adult video chat - Winforms datagridview rowvalidating

I tried using the Row Validating event handler but it was not called after cell value has been changed.

winforms datagridview rowvalidating-29

provides a convenient way to realize data validation before it is committed to the underlying data source.

SOLUTION To achieve data validation prior the row is committed, you can handle the Cell Validating event, which is raised by the control when the current cell changes or when it goes out of edit mode.

Reject Changes method is called, any rows still in edit-mode cancel their edits. Modified and deleted rows return back to their original state (Data Row State. You can use the Cell Validating event to check the contents of the cell just before it is committed.

If you don't like it (whatever your validation rules are), you have a few options. The user gets an error icon on the row, and cannot leave the cell.

However, the user may prefer to validate all the data cells in a row at once.