Skip to main content
A newer version of this page is available. .

RepositoryItemDateEdit.NullDate Property

Gets or sets a value that is interpreted as the null date.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(null)]
public virtual object NullDate { get; set; }

Property Value

Type Default Description
Object *null*

A value interpreted as the null date.

Remarks

The editor’s DateEdit.DateTime property (which is of the DateTime type) is in sync with the editor’s EditValue property (which is of the Object type). When you set the DateTime property, the same value is assigned to the EditValue property. When you assign a value to the EditValue property, this value is converted to the DateTime type and assigned to the editor’s DateTime property.

When the EditValue property is set to null or any object that cannot be converted to a valid DateTime value, the editor’s DateTime property is set to a special null date. By default, the null date is equal to the static DateTime.MinValue field value. You can specify a custom null date with the NullDate property. If the NullDate property specifies an object that cannot be converted to a valid DateTime value, static DateTime.MinValue field value is regarded as the null date.

When the editor’s EditValue property is set to null, DBNull or NullDate (provided that NullDate is set to a non-default value), the editor displays the string specified by the RepositoryItem.NullText property (an empty string by default).

Note

The NullDate property is not supported when a DateEdit control is bound to a data source and the DataSourceUpdateMode.OnPropertyChanged flag is set in the corresponding Binding object.

See Also