Edit this page

Validation Error Indicator Remains

PROBLEM

You apply a row-level validation setting a custom ValidationResult when invoking the RowValidating event. Then you correct the value, but the error indicator is still displayed.

CAUSE

The problem comes from the fact that you are introducing some user errors when validating RadGridView through the RowValidating event.

SOLUTION

With Q3 2013 official release we have introduced a new property for GridViewRowEditEndedEventArgs - UserDefinedErrors. It contains all user errors for the row being edited. By handling the RowEditEnded event you can clear these errors and restore the valid state of the row.

Example 1 shows how the property can be used.

Example 1: Clearing user-defined errors

private void rgvTest_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
{
    if (e.EditAction == GridViewEditAction.Cancel)
    {
        e.UserDefinedErrors.Clear();
    }
}
Private Sub rgvTest_RowEditEnded(ByVal sender As Object, ByVal e As GridViewRowEditEndedEventArgs)
    If e.EditAction = GridViewEditAction.Cancel Then
        e.UserDefinedErrors.Clear()
    End If
End Sub

See Also

Was this article helpful? Yes No

Give article feedback

Tell us how we can improve this article

Dummy