views:

332

answers:

1

I have a DataGrid that has as one of its columns a DatePicker (for the editing template). Is there a way to keep this but still allow a user to enter in a NULL date?

Thanks very much for any help.

A: 

Do the following (in Silverlight 4):

1) Bound property of DataContext must be Nullable (or Datetime?)

2) In XAML set TargetNullValue='' of binding property something like:

Text="{Binding DocumentDate, Mode=TwoWay, StringFormat='yyyy-MM-dd', TargetNullValue=''}"
synergetic