WPF Xceed Grid: How to prevent/disable validation for objects that implement IDataErrorInfo


From the Xceed documentation:

"Built-in support for IDataErrorInfo provides business-object level validation that can be used in combination with validation rules.

Unless the ValidationRules collection is cleared, it will always contain an ExceptionValidationRule and DataErrorValidationRule. If the DataErrorValidationRule is excluded from the collection of validation rules, validation errors reported by IDataErrorInfo will be ignored. "

The solution is to manually loop over the columns and clear the validators

    foreach(Column c in grid.Columns)
    {
                c.CellValidationRules.Clear();
    }

No comments:

Post a Comment