Null values can be difficult to handle without appropriate rules or settings. However, DateEdit provides flexible rules for handling null values and controlling relevant aspects in a variety of cases.
The DateEdit control allows displaying null values through the NullText property of DisplayFormat when the control is in ReadOnly mode. It is possible to override the NullText property in DisplayFormat to display watermark in the DateEdit control.
This is default mode of DateEditor. In edit mode (when ReadOnly is false), DateEdit allows displaying null values by setting the NullText property of EditFormat.
In both modes, it is possible to display empty strings by setting the EmptyAsNull property to true. When editing date time values in DateEdit with DateTimeInput set to true, the control appears empty representing the null value. As you start editing values in control, the control turns to the last non-null value assigned to it or today’s date.
The following image shows DateEdit displaying null text (watermark) in the ReadOnly mode.
The following code snippet shows how to show null text in DateEdit in ReadOnly mode.