This, therefore, undoes any action you perform in the handler.
What you have to do instead is change the value in the editing control (remembering not to cancel the event).
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.
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.
Note that only the Cell Validating event can keep the editor active,when the validation fails and it does not allow the user to exit the cell until a valid value is filled.
Handle the Cell Validated event to perform post-validation processing. No values are changed in the data source before validation.Please, could you elaborate a bit more and describe in detail what you want to achieve. I have a grid with values in it; quantity, price, discount (%), unit price.From within that event, you can indicate that the user's value is invalid by setting the Error Text value of the cell or row. However, I am not sure that I fully understand your scenario. Regards, Jack the Telerik team I think I am looking for the same effect.I would like to manipulate a cell in my Data Grid View when it is validating so that if the user enters a value that is not valid for the database, but is easily converted to valid data, the program will change the value to an appropriate one.I am able to validate my value properly but when I try to change it to something valid I get a Data Error. You should never attempt to change the cell value in the handler for this event, because unless you cancel the event (in which case the user is stuck in edit mode), the cell value is set to the value from the editing control immediately after the event finishes.I would like to change the value of cell value which user inputs there and do the trim before to avoid left and right spaces over value before it will be validated. Currently this is my code without this feature: Private Sub Grid_Cell Validating(sender As Object, e As Data Grid View Cell Validating Event Args) Handles Grid. When the validation fails, the editor is closed, but the user cannot change the current row in the grid until a valid cell value is entered.In this situation the editor is not kept active when the validation fails and pressing the Esc key does not revert the changes as the editor is already closed.