DataGrid中的Silverlight DatePicker允许NULL日期

Phi*_*hil 4 silverlight datepicker

我有一个DataGrid,它的列a之一DatePicker(用于编辑模板).有没有办法保持这个但仍允许用户输入NULL日期?

syn*_*tic 5

执行以下操作(在Silverlight 4中):

1)DataContext的绑定属性必须是Nullable(或Datetime?)

2)在XAML中设置TargetNullValue =''的绑定属性,如:

Text="{Binding DocumentDate, Mode=TwoWay, StringFormat='yyyy-MM-dd', TargetNullValue=''}"
Run Code Online (Sandbox Code Playgroud)