Skip to main content

RepositoryItemTimeSpanEdit.NullTimeSpan Property

Gets or sets a value that is interpreted as the null value assigned to the TimeSpanEdit.TimeSpan property when TimeSpanEdit.EditValue is set to null or any value that cannot be converted to the TimeSpan type.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.2.dll

Declaration

[DefaultValue(null)]
[DXCategory("Behavior")]
public TimeSpan? NullTimeSpan { get; set; }

Property Value

Type Default Description
Nullable<TimeSpan> null

The value regarded as the null value.

Remarks

The editor’s TimeSpanEdit.TimeSpan property (which is of the TimeSpan type) is in sync with the editor’s TimeSpanEdit.EditValue property (which is of the Object type). When you set the TimeSpan 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 TimeSpan type and assigned to the editor’s TimeSpan property.

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

When the editor’s EditValue property is set to null, DBNull or NullTimeSpan, the editor displays an empty string. To display a custom string in these cases, assign it to the RepositoryItem.NullText property.

See Also