隐藏WPF DataGrid行错误 [英] Hide WPF DataGrid Row Error
问题描述
您是否已签出如何使用DataGrid控件实施验证? a>?
这取决于感叹号在DataGrid中显示的位置。例如,如果在发生验证的行上,您可以实现自己的DataGrid.RowValidationErrorTemplate或DataGrid.ValidationErrorTemplate。
有很多不同情况的示例链接。
I have a datagrid where I am implementing my own validation checks. When there is an error, I set the row's border to red and display a message to the user what the error is. However, in my datagrid, there is a red exclamation point that shows up as well. I was wondering if there is a way to hide this? I tried checking the Row.HasErrors() but that always returns false and Row.ClearErrors() won't remove the exclamation point either.
Have you checked out How to: Implement Validation with the DataGrid Control?
It depends a bit on exactly where the exclamation point is showing in the DataGrid. For example, if it on the row where the validation occurs you can implement your own DataGrid.RowValidationErrorTemplate or DataGrid.ValidationErrorTemplate.
There are quite a few examples for various situations in the link.
这篇关于隐藏WPF DataGrid行错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!