Row Validation does not clear on Cancel

2 posts, 0 answers
  1. Joel Palmer
    Joel Palmer avatar
    175 posts
    Member since:
    May 2009

    Posted 14 Aug 2013 Link to this post

    I can't get the validation to clear on a row when I press escape/cancel the edit.  I have attached a picture without my work-around that shows grid row BST 1 and BST 3 I entered an invalid value then pressed escape.  The current row is BST 5. 

    • Add DataAnnotations on your class properties (like String Length). 
    • Create a List<Class>
    • Bind a RadGridView to the List.
    • Enter an invalid value so the validations flag in the grid.
    • Press escape.

    At this point, I expected the "red" validations in the row to clear... but they don't.  I figured out a work around which seems odd and I'm hoping that you can give me a better way of doing this.

    Grid Definition:

    <telerik:RadGridView
        x:Name="formGrid"
        ShowColumnSortIndexes="False"
        ShowGroupPanel="False"
        ShowInsertRow="True"
        ColumnWidth="125"
        AlternateRowBackground="Cornsilk"
        AlternationCount="2"
        AutoGeneratingColumn="formGrid_AutoGeneratingColumn"
        ValidatesOnDataErrors="InEditMode"
        ScrollViewer.HorizontalScrollBarVisibility="Visible"
        ScrollViewer.VerticalScrollBarVisibility="Visible"
        EnableColumnVirtualization="False"
        RowEditEnded="formGrid_RowEditEnded"
        />


    Work Around:

    private void formGrid_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
    {
        if (e.EditAction == GridViewEditAction.Cancel)
        {
            ((RadGridView)sender).Rebind();
        }
    }

  2. Yoan
    Admin
    Yoan avatar
    1159 posts

    Posted 15 Aug 2013 Link to this post

    Hi Joel,

    I've tried to reproduce the problem you report but to no avail. I have prepared a sample project using the Q2 2013 SP1 version of our controls. Could you check it and modify it in order to demonstrate the issue? 

    Looking forward to hearing from you! 

    Regards,
    Yoan
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top