ASPxCalendar
- 3 minutes to read
The ASPxCalendar control allows end users to select dates and navigate through months and years.
Main Features
Multiple Date Selection
End users can work in single or multiple date selection mode (ASPxCalendar.EnableMultiSelect). In multiple date selection mode, users can select individual dates or a range of dates. To choose a range of dates, select the initial date and hold the left mouse button (or the Shift key) down while moving the mouse to the final date. Hold down the Ctrl key to add a date to or remove it from the selection. Click a week number to select the entire week.
Highlight Dates
The ASPxCalendar.HighlightToday and ASPxCalendar.HighlightWeekends properties allow you to highlight today’s date and weekend days.
Customizable Appearance
The following table lists API members you can use to customize the Calendar’s appearance:
Element Visibility Appearance Today Button ASPxCalendar.ShowTodayButton ASPxCalendar.ButtonStyle Clear Button ASPxCalendar.ShowClearButton ASPxCalendar.ButtonStyle Week Numbers ASPxCalendar.ShowWeekNumbers ASPxCalendar.WeekNumberStyle Day Headers ASPxCalendar.ShowDayHeaders ASPxCalendar.DayHeaderStyle Header ASPxCalendar.ShowHeader ASPxCalendar.HeaderStyle Month Navigation Buttons ASPxCalendar.EnablePeriodNavigation ASPxCalendar.NextPeriodImage, ASPxCalendar.PrevPeriodImage Year Navigation Buttons ASPxCalendar.EnableLargePeriodNavigation ASPxCalendar.NextLargePeriodImage, ASPxCalendar.PrevLargePeriodImage Multi-Month View
The Calendar control can display multiple months and organize them in several rows and columns. The ASPxCalendar.Columns and ASPxCalendar.Rows properties enable you to define the number of columns and rows. (Show Online Demo)
Month-Year Picker Mode
The Month-year Picker mode allows you to specify which date component an end user can select: a day, a month or a year. You can click the header to change the calendar view (fast navigation). Use the following settings to specify how users select dates and restrict the available calendar views:
Property Description PickerType Specifies a date component an end user can select (a day, month or year). FastNavProperties.InitialZoomLevel Specifies the initial Calendar view. FastNavProperties.MaxZoomLevel Specifies the earliest available Calendar view. For example, if the CalendarFastNavProperties.MaxView property is set to “Months”, the picker displays the months of a particular year and January is the earliest available Calendar view item. Inline Navigation
The Calendar can display the fast navigation panel in the editor or popup window (CalendarFastNavProperties.DisplayMode).
Render Custom Days
You can customize each calendar day’s appearance before the browser renders a page. (Show Online Demo)
Built-in Validation
The Calendar control allows you to validate data on the client and server sides. Refer to the following topic for more information: Validation.
Client-Side APIs
The ASPxClientCalendar object is the client-side equivalent of the ASPxCalendar control. This object exposes the control’s comprehensive client-side API.
Method Description ASPxClientCalendar.ClearSelection Deselects all selected dates. ASPxClientCalendar.DeselectDate Deselects the specified date. ASPxClientCalendar.DeselectRange Deselects the range of dates. ASPxClientCalendar.GetMaxDate Gets the earliest date a user can select. ASPxClientCalendar.GetMinDate Gets the furthest date a user can select. ASPxClientCalendar.GetSelectedDate Returns the selected date. ASPxClientCalendar.SetSelectedDate Sets the calendar’s selected date. ASPxClientCalendar.GetSelectedDates Gets a list of selected dates. ASPxClientCalendar.GetVisibleDate Gets the date (day, month, year) that the calendar displays. ASPxClientCalendar.IsDateSelected Specifies whether the specified date is selected. ASPxClientCalendar.SelectDate Selects the specified date. ASPxClientCalendar.SelectRange Selects the specified range of dates. ASPxClientCalendar.SetMaxDate Sets the calendar’s furthest date an end user can select. ASPxClientCalendar.SetMinDate Sets the calendar’s earliest date an end user can select. ASPxClientCalendar.SetSelectedDate Sets the calendar’s selected date. ASPxClientCalendar.SetVisibleDate Sets the date (day, month, year) the calendar displays.