Validation errors not shown in GridView immediately

2 posts, 0 answers
  1. haagel
    haagel avatar
    52 posts
    Member since:
    Feb 2010

    Posted 12 Oct 2011 Link to this post

    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?

  2. Yordanka
    Yordanka avatar
    634 posts

    Posted 17 Oct 2011 Link to this post

    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,
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top