But now it is still triggered if the user clicks into the cell to edit the invalid value.
How can I force all the cells to validate in a datagrid in a c# winform application when a Tool Strip Button is pressed?
When you display data entry functionality to users, you frequently have to validate the data entered into your form.
Canceling this event cancels the changes to the current cell.When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source.When this event is canceled in virtual mode, the Cell Value Pushed event will not be raised.2) Detach the event hander before the unwanted event triggers and re-attach after. so when i click the add button the cell validating event triggers i have posted the cell validating event do you know how to solve this thanxxx code!!!Something there is causing the cell validating event to fire. [Edit] The validating event is firing because focus is being moved from the DGV to the button.