开发者

C# code equivalent for Applying RowValidationRules on DataGrid in WPF

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜