Set null or empty value
RadDateOnlyPicker has NullableValue property which supports null value (The default Value property is of type DateOnly which is value type and it cannot be set to null). The NullableValue property can be set to null as any other reference type, the built-in SetToNullValue method can be used as well:
Set to null
this.radDateOnlyPicker1.NullableValue = null;
this.radDateOnlyPicker1.SetToNullValue();
Me.RadDateOnlyPicker1.NullableValue = Nothing
Me.RadDateOnlyPicker1.SetToNullValue()
If you set the NullText property, you can conditionally display a text based on the selected date. The null text will be displayed when the NullableValue is null or when the NullDate property value matches the current value.
Setting the NullText property of RadDateOnlyPicker
this.radDateOnlyPicker1.NullText = "No date selected";
Me.RadDateOnlyPicker1.NullText = "No date selected"
When the NullDate property value is equal to the control value no text will be displayed in the text box part (if the NullText is set it will appear). The default value of the property is MinDate, which is 1/1/1. Below is the code snippet for setting NullDate to a specific date (01-01-2024):
Setting the NullDate property of RadDateOnlyPicker
this.radDateOnlyPicker1.DateOnlyPickerElement.NullDate = new DateOnly(2024, 01, 01);
Me.RadDateOnlyPicker1.DateOnlyPickerElement.NullDate = New DateOnly(2024, 1, 1)