Hello, Claude,
RadGridView provides a convenient way to perform validation before data is committed to the underlying data source. You can validate data by handling
CellValidating event which is raised by
RadGridView when the current cell changes or when the cell loses input focus (when pressing Enter key). Canceling this event prevents the user from exiting the cell until a valid editor value is entered or the edit process is canceled.
Please have in mind that when you have an active editor in the grid, its value is not committed to the cell yet. Hence, the extracted value from the
GridViewDataRowInfo is different than the one in the editor. In this case, feel free to use the CellValidatingEventArgs.
Value property. Thus, you won't be stuck if the entered value is valid. A sample approach is demonstrated here:
https://docs.telerik.com/devtools/winforms/controls/gridview/editors/data-validation In case you are still experiencing any further difficulties, it would be greatly appreciated if you can provide a sample project demonstrating the undesired behavior that you are facing. Thus, we would be able to investigate the precise case and think about a suitable solution.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.