Back to Devexpress

Calendar

aspnetmvc-8981-components-data-editors-extensions-calendar.md

latest1.6 KB
Original Source

Calendar

  • Dec 17, 2020
  • 4 minutes to read

The Calendar extension allows end-users to select dates and navigate through months and years.

Implementation Details

Calendar is realized by the CalendarExtension class. Its instance can be accessed via the ExtensionsFactory.Calendar helper method, which is used to add a Calendar extension to a view. This method’s parameter provides access to the Calendar ‘s settings, implemented by the CalendarSettings class, allowing you to fully customize the extension.

Calendar ‘s client counterpart is represented by the MVCxClientCalendar object.

Declaration

Calendar can be added to a view in the following manner.

razor
@Html.DevExpress().Calendar(settings => {
    settings.Name = "calendar1";
    settings.SelectedDate = new DateTime(2010, 11, 22);
}).GetHtml()

Note

The Partial View should contain only the extension’s code.

The code result is demonstrated in the image below.

Main Features

  • Multiple Date Selection

  • Date Highlighting

  • Fully Customizable Appearance

  • Multi-Month View

  • Month-Year Picker Mode

  • Custom Day Rendering

  • Built-in Validation

  • Full-Featured Client-Side API