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

DateEditProperties.DateOnError Property

Gets or sets a value that specifies how the date editor responds to an invalid date being entered by an end user.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.2.dll

Declaration

[DefaultValue(DateOnError.Undo)]
public DateOnError DateOnError { get; set; }

Property Value

Type Default Description
DateOnError **Undo**

A DateOnError value specifying how to respond to an invalid date value being entered.

Available values:

Name Description
Undo

An invalid date is replaced with the previously validated date.

Null

An invalid date is replaced with the null value.

Today

An invalid date is replaced with the current date.

Remarks

End users are allowed to enter text that represents the required date into a date edit control’s edit box. Each time a date editor performs validation (i.e. when the editor is about to lose focus) the entered text is converted into the appropriate date/time type. If the conversion fails the date provided by the DateOnError property is assigned to the editor.

Use the DateOnError property to specify what should be substituted in place of an invalid value. It is possible to revert to the previous value (the last valid value), set the editor’s value to the current date or to a null value. See the DateOnError type for the available options.

Note

The DateOnError property synchronizes its value with the editor’s ASPxDateEdit.DateOnError property.

See Also