Cell.Errors not clearing

3 posts, 0 answers
  1. Gavin
    Gavin avatar
    8 posts
    Member since:
    Mar 2013

    Posted 22 Aug 2014 Link to this post

    I am using 2013 q3 of the radgridview, and I need to validate my object in the row validating and cell validating event because some properties are required field.  In the row validating event, I'm explicitly clearing all the validationResults and appending 1 or more new validationresults to certain properties.  However, I found that Cell.Errors are not cleared when I clear validationResults, instead they are appeneded everytime I add a new validationresult in the row validating event.  How do I clear individual cell errors?


    //rowvalidating event
    if(conditionNotValid)
    {
    var r = param as Telerik.Windows.Controls.GridViewRowValidatingEventArgs;
    r.IsValid = false;
    r.ValidationResults.Clear();


    foreach (.Infrastructure.ValidationError error in errors)
    {
                  r.ValidationResults.Add(new GridViewCellValidationResult() { ErrorMessage = error.ErrorMessage, PropertyName = error.PropertyName });
    }

    return;
    }


    //////////////////////
    //Cell validating event
    ////////////////////// 
    var c = param as Telerik.Windows.Controls.GridViewCellValidatingEventArgs;
    c.Cell.Errors // errors does  not get cleared, but gets appended to this list !!!!!!!!!!














































  2. Gavin
    Gavin avatar
    8 posts
    Member since:
    Mar 2013

    Posted 23 Aug 2014 in reply to Gavin Link to this post

    I found the ClearIfSet extension method for GridViewCell.  It is found in diagram.core.dll  
    In the row validating event, I loop through each cell to clear it's ErrorsProperty now it looks like the errors no longer append itself.
  3. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 27 Aug 2014 Link to this post

    Hello,

    I can suggest you checking the "Validation errors not cleared" troubleshooting article. Does this help? 

    Regards,
    Didie
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top