如何在WPF中验证DataGrid单元格 [英] how to Validate DataGrid cell in WPF

查看:629
本文介绍了如何在WPF中验证DataGrid单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个datagrid,datagrid包含很多列,其中一列是Quantity,如果用户给出零值,该列不应该接受零值,那么错误将显示

解决方案

你可以有ValidationRule,请查看下面的代码项目教程

WPF中的简单验证 [ ^ ]

Windows演示文稿中的验证基金会 [ ^

I have a datagrid in that datagrid contain many columns and one of the column is Quantity , that column should not accept zero value if the user will give zero value then error will show

解决方案

you can have ValidationRule for that, check below tutorials from codeproject
Simple Validation in WPF[^]
Validation in Windows Presentation Foundation[^]


这篇关于如何在WPF中验证DataGrid单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆