开发者

C# code equivalent for Applying RowValidationRules on DataGrid in WPF

开发者 https://www.devze.com 2023-02-06 21:45 出处:网络
We can apply RowValidationRules on a DataGrid by using following XAML. <DataGrid.RowValidationRules>

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

精彩评论

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