允许数据杂志WPF中的空单元格
我目前正在使用一个数据杂志,在其中将值留为几周,直到需要填充它。我的数据杂志将不允许该值为空并显示一个红色框。如何在此列中允许零值?
我试图使用validation.errortemplate =“ {x:null}”
在XAML中删除所有行验证。
I am currently using a datagrid where I leave the value empty for a few weeks until I need to fill it. My datagrid will not allow the value to be empty and shows a red box. How can I allow a null value in this column?
I have tried to remove all row validation with Validation.ErrorTemplate="{x:Null}"
in xaml but that hasn't changed anything either.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设单元格显示了类型
dateTime
的值,这是一种不可删除的类型。因此,您必须有一个价值。您可以使用
String
属性显示废料日期,或者使用DateTime
使用dateTime进行
dateTime
? dateTime = null;I assume that cell is displaying a value of type
DateTime
, which is a non-nullable type. Therefore you have to have a value for it.You could either use a
string
property to display the scrap date, or make theDateTime
nullable usingDateTime? dateTime = null;