The Value property is of type DateTime. Because this is a value type, it cannot be null or empty. However, RadDateTimePicker has a NullDate support, which means that a specific date is defined as a NullDate and when you have such date selected, RadDateTimePicker will show its NullText (which by default is an empty string).
Copy[C#] Calling the SetToNull method of RadDateTimePicker
this.radDateTimePicker1.DateTimePickerElement.SetToNullValue();
Copy[VB.NET] Calling the SetToNull method of RadDateTimePicker
Me.RadDateTimePicker1.DateTimePickerElement.SetToNullValue()
By default the NullDate is set to MinDate, which is 1/1/1900. So by using the above code you will have Value equal to 1/1/1900 and no text in the textbox portion. Below is the code snippet for setting NullDate to a specific date (01-01-2000):
Copy[C#] Setting the NullDate property of RadDateTimePicker
this.radDateTimePicker1.DateTimePickerElement.NullDate = new DateTime(2000, 01, 01);
Copy[VB.NET] Setting the NullDate property of RadDateTimePicker
Me.RadDateTimePicker1.DateTimePickerElement.NullDate = New DateTime(2000, 1, 1)
If you set the
NullText property, you can conditionally display a text based on the selected date (if it is the same as the
NullDate).
Copy[C#] Setting the NullText property of RadDateTimePicker
this.radDateTimePicker1.NullText = "No date selected";
Copy[VB.NET] Setting the NullText property of RadDateTimePicker
Me.RadDateTimePicker1.NullText = "No date selected"