This is a migrated thread and some comments may be shown as answers.

Validation Not Triggering On Load - RadGridView

1 Answer 269 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Thanos
Top achievements
Rank 1
Thanos asked on 31 Jan 2017, 02:16 PM

I have a RadGridView that uses Row-Level Validation (as per this article) to validate the objects in the Collection we bind to. When Adding or Editing grid items, the Validation works as expected.

However, if the user loads data that is not valid, the RadGridView does not highlight those rows in red. The user as to try to edit the row before the red invalid indication appears.

Is there a way to force the RadGridView to validate its contents? Or perhaps there is a different Validation Event I need to listen for?

Thanks for your help,
-Thanos

1 Answer, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 03 Feb 2017, 09:08 AM
Hello Thanos,

As suggested in the following article, each one of the validation events is fired only when the user is trying to commit new data in the RadGridView control. They were designed to only handle new data inserted by the user and do not occur when RadGridView loads data.

If you need to handle the validation on load, you will need to use another mechanism - either through DataAnnotations or through the IDataErrorInfo/INotifyDataErrorInfo interfaces.

Regards,
Dilyan Traykov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Thanos
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or