Show theme settings Shopping cart Download trialFree Trial
Change Theme Settings
Change Theme Settings
Show All Themes

Date Edit in Date Range mode


Validation settings for the Model's "End" property:
DateRangeAttribute.MinDayCount = 1;
DateRangeAttribute.MaxDayCount = 30

Two DevExpress ASP.NET MVC Date Edit extensions can be combined to introduce date range selection capabilities in your web application. One editor is used to specify the start date, another - to specify the end date. To link editors, decorate the end-date editor's model field with the DateRange attribute and set the StartDateEditFieldName property of the attribute to the field name of the start-date editor.

You can customize the date range settings using the following attribute properties.

  • MinDayCount - specifies the minimum number of days in a range.
  • MaxDayCount - specifies the maximum number of days in a range.

If the number of days in the specified range exceeds the specified range limits, an error message is displayed when the Submit button is clicked.

Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
The source code files for this demo are installed (by default) in the following directory:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\MVCxDataEditorsDemos