문제

I am binding a Date field to RadDatePicker. When there is a null value for the Date field, the RadDatePicker displays 01/01/0001, but I want it to remain blank.

도움이 되었습니까?

해결책

If you are bind not nullable datetime variable i.e (DateTime) to control then it will use default 01/01/001 date instead of Empty.... So if you want the default value as a Empty then just change the datatype of your variable which is bound to control to (DateTime?).....

DateTime ===> DateTime?

It works fine...

다른 팁

You will have to set the SelectedDate to null.

It is as follows:

Rdtp.SelectedDate = null;

In xaml you will have to set DateTimeWatermarkContent to empty as follows

DateTimeWatermarkContent="" in

<telerik:RadDatePicker x:Name="Rdtp" DateTimeWatermarkContent="" />

Hope Its Helpful.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top