<DataGridTextColumn SortMemberPath="Model.DtlName">
<DataGridTextColumn.Binding>
<Binding Path="Model.DtlName" UpdateSourceTrigger="PropertyChanged" >
<Binding.ValidationRules >
<validation:NotNullOrEmptyRule ValidatesOnTargetUpdated="True"/>
</Binding.ValidationRules>
</Binding>
</DataGridTextColumn.Binding>
</DataGridTextColumn>
前台代码如上,在 DataGrid的一列里加了非空验证,当输入为空时会显示红色边框提示,但是在后台不知道怎么获取到前台是不是有验证错误。谢谢!
喵喵时光机