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

Validation errors not shown in GridView immediately

1 Answer 145 Views
GridView
This is a migrated thread and some comments may be shown as answers.
haagel
Top achievements
Rank 1
haagel asked on 12 Oct 2011, 11:15 AM

I'm using the MVVM pattern to build an application. I have a GridView that shows a collection of ViewModels that are connected to entities. These entities have validation implemented in them.

 

All this works, and the grid indicates cells that have validation errors by giving them a red border.

 

It is possible for the entities to be edited in another place in my application while they are displayed in the GridView. When this happens, these entities will be reloaded in the GridView and validated again. This works and I have verified that the validation errors are set as they should.

 

However, the GridView doesn't show the validation error immediately. If a cell that is visible has an error, the red border is not displayed. But if I scroll the GridView so that the cell is no longer visible, and then scroll it back into view, the red border appears!

 

Somehow I need to tell the GridView to update the validation errors. How can I do that?

1 Answer, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 17 Oct 2011, 05:13 PM
Hello Haagel,

I have tried to simulate your scenario using RadDataForm and RadGridView with enabled editing but I couldn't get the reported problem. You can check the attached test application - type "1" for Number column and the error will be shown. Feel free to modify it in order to demonstrate the issue.

It would be very helpful if you share more details about the way you have implemented the validation. Do you use DataAnnotations, IDataErrorInfo or error in the property setter? Also, how do you edit the item outside of the grid? 
 
Kind regards,
Yordanka
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
haagel
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
Share this question
or