However, pressing the Esc key in this situation will revert the initial value of the cell and it will close the editor. The Row Validating event has a slightly different behavior.
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.
The function looks something like this: If a cell enters edit mode and the value is changed, then the value displayed in the cell is not updated with the formatted version.
However, if a cell enters edit mode and then leaves edit mode with no changes, the formatted value from our function is applied.
Now, after having done that, if you click the same cell to enter edit mode and then click somewhere else, the same function above will run, only this time the cell in the UI will be updated to display "00001.00" properly. The Validating event is usually used with the Cancel flag if the validation does not pass.
Likewise, if you edit that formatted value and remove a zero, the function will fail to update the value, but if after doing that, you click on the cell and then leave it without making any changes, it will be formatted again and the missing zero will be added back. When you set the cell will remain in edit mode allowing your end users to enter the correct value.
This scenario can be achieved by using the Row Validating event, which is fired when the user tries to change the current row (changing to another row or when the control loses focus).
In my sceanrio, i have removed already entered text in the cell and press on the "Enter" key.The validating event handler can only update the cell value if that value was not actually changed during editing. In your actual setup indeed it is more appropriate to use the Cell End Edit event because you would want to change the actual cell`s value. Rad Grid View provides a convenient way to perform validation before data is committed to the underlying data source.Here is a list of all validation events: Cell Validating: Fires when a cell loses input focus, enabling content validation. Cell Validated: Fires after the cell has finished validating. Row Validated: Fires after a row has finished validating.