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

DateEditProperties.MaxDate Property

Gets or sets the maximum date allowed to be entered into the editor by an end-user.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue(typeof(DateTime), "")]
public DateTime MaxDate { get; set; }

Property Value

Type Default Description
DateTime String.Empty

A DateTime object that specifies the editor’s maximum allowed date.

Remarks

Use the DateEditProperties.MinDate and MaxDate properties to limit user input to dates falling within a specific range. The MaxDate property specifies the upper limit of the allowed date range.

Dates which are out of the specified range cannot be entered into the date editor by end-users either by typing within the editor’s edit box or using the dropdown calendar. In the dropdown calendar, these dates are displayed using a specific style (CalendarProperties.DayOutOfRangeStyle) and don’t respond to user clicks. When an end-user types an unavailable date in the editor’s edit box, a warning message is displayed if the DateEditProperties.ShowOutOfRangeWarning property is set to true. After the editor loses focus, the date automatically changes to the last specified allowed date.

Note that programmatic manipulation on the date editor’s value isn’t limited by the DateEditProperties.MinDate and MaxDate property values.

Note

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

...
DateEdit.MaxDate = DateTime.Now;
...

Online Examples

See Also