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 t开发者_如何学Chrough C# Code?
This should do the trick:
grid.RowValidationRules.Add(new CourseValidationRule() {
ValidationStep = ValidationStep.UpdatedValue
});
Note that you need to set the ValidationStep.
精彩评论