I'am trying to implement a data validation for the columns in my RadGridView. I would like to validate the data that is loaded into the grid, not the data that is entered by the user into the grid. To to this I've written a ValidationRule which returns a ValidationResult and implemented this rule in the binding of the column:
<
telerik:GridViewDataColumn
Header
=
"Test"
>
<
telerik:GridViewDataColumn.DataMemberBinding
>
<
Binding
Path
=
"MyObject.MyProperty"
Converter
=
"{StaticResource TestConverter}"
NotifyOnValidationError
=
"True"
>
<
Binding.ValidationRules
>
<
validators:TestValidator
ValidatesOnTargetUpdated
=
"True"
/>
</
Binding.ValidationRules
>
</
Binding
>
</
telerik:GridViewDataColumn.DataMemberBinding
>
</
telerik:GridViewDataColumn
>
These are the settings I've set on my RadGridView:
<
telerik:RadGridView
telerik:StyleManager.Theme
=
"Expression_Dark"
AutoGenerateColumns
=
"False"
CanUserDeleteRows
=
"True"
CanUserInsertRows
=
"False"
ShowColumnHeaders
=
"True"
SelectionMode
=
"Extended"
EnableColumnVirtualization
=
"False" Ro
wIndicatorVisibility
=
"Collapsed"
RowDetailsVisibilityMode
=
"Collapsed"
EditTriggers
=
"None"
ClipboardCopyMode
=
"None"
ClipboardPasteMode
=
"None"
>
The ValidationRule is called when loading data into the Grid and a negative ValidationResult is returned, but the error is not displayed in the Grid. What am I doing wrong?