Reputation: 30097
We can apply RowValidationRules on a DataGrid by using following XAML.
<DataGrid.RowValidationRules>
<local:MyValidationClass ValidationStep="UpdatedValue"/>
</DataGrid.RowValidationRules>
I want to know how can I achieve same through C# Code?
Upvotes: 1
Views: 1033
Reputation: 3658
This should do the trick:
grid.RowValidationRules.Add(new CourseValidationRule() {
ValidationStep = ValidationStep.UpdatedValue
});
Note that you need to set the ValidationStep.
Upvotes: 2