All docs
V18.2
20.2 (EAP/Beta)
The page you are viewing does not exist in version 20.2. This link will take you to the root page.
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
18.1
17.2

Overview - Calendar

Calendar is a calendar control that allows dates to be selected, and provides end-users with an easy way of navigating 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.

View code (ASPX):

<% 
    Html.DevExpress().Calendar(
        settings => {
            settings.Name = "calendar1";
            settings.SelectedDate = new DateTime(2010, 11, 22);
        }
    )
    .Render();
%> 

View code (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.

calendar-declaration.png

See Also