本文介绍了如何将日期选择器的值绑定到不可为空的属性时将其设置为null?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我有一个Patient实体,它包含几个日期属性,例如DateOfBirth和AccidentDate.这些是非空属性,因为它们是必需的,但是,当添加新患者时,我不希望这些属性自动填充, 就像默认情况下一样,因为用户很可能会忘记更改它们.

I have a Patient entity, and this contains a couple of date properties, such as DateOfBirth and AccidentDate. These are non-nullable properties, as they are required, however, when a new patient is added, I don't want these properties populating automatically, as they are by default, as the user is very likely to forget to change them.

如何清除这些值?我尝试获取日期选择器控件并将SelectedDate属性设置为null,但屏幕上的控件仍显示当前日期.我无法将实体的日期设置为null,因为它不可为空.

How can I blank out the values? I tried getting the date picker controls and setting the SelectedDate property to null, but the control on the screen still showed the current date. I can't set the entity's date to null as it's not nullable.

有人有什么想法吗?谢谢

Anyone any ideas? Thanks

Lightswitch的免费自定义控件!对Lightswitch开发人员的有用控件的集合.从Visual Studio库中下载.

FREE custom controls for Lightswitch! A collection of useful controls for Lightswitch developers.Download from the Visual Studio Gallery.

如果您真的很无聊,可以在以下位置阅读有关使用.NET和Microsoft某些较新技术的实验的信息 http://dotnetwhatnot.pixata.co.uk/

If you're really bored, you could read about my experiments with .NET and some of Microsoft's newer technologies athttp://dotnetwhatnot.pixata.co.uk/

推荐答案


这篇关于如何将日期选择器的值绑定到不可为空的属性时将其设置为null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-26 22:05
查看更多