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 !!!!!!!!!!
//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 !!!!!!!!!!