Set default value of RadDatePicker to NULL when date is not set

前端 未结 1 836
一整个雨季
一整个雨季 2021-01-28 16:01

I\'m binding the RadDatePicker to a viewModel dateTime property. when the property is null in database i get 01/01/0001. How to i change this behavior to just leave the date fie

相关标签:
1条回答
  • 2021-01-28 16:43

    Set the SelectedDate to null (and not DBNull):

    RadDatePicker1.SelectedDate = null;
    

    and in xaml set DateTimeWatermarkContent to the empty string:

    <telerik:RadDatePicker x:Name="RadDatePicker1" DateTimeWatermarkContent="" />
    
    0 讨论(0)
提交回复
热议问题