RadCalendar
Represents a selection control that allows you to select dates from a calendar.
The <strong>Calendar</strong> control allows the user to select a single date. The user can navigate in the <strong>Calendar</strong> by clicking the arrow buttons in the calendar header that would cycle through the list of days, months or years. Clicking in-between the two arrows would change the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayMode" data-throw-if-not-resolved="false"></xref> of the calendar so that it displays a year if a month was displayed (The same applies for. Clicking the button with today's date would navigate to the month view of the current month. The <strong>SelectionMode</strong> allows more than one date to be selected. There are three modes of selection - SelectionMode.Single, SelectionMode.Multiple and SelectionMode.Extended. Advanced keyboard selection - dragging while holding Ctrl or/and Shift is supported. The <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDates" data-throw-if-not-resolved="false"></xref> property is a list of all selected dates. The <xref href="Telerik.Windows.Controls.RadCalendar.DisplayMode" data-throw-if-not-resolved="false"></xref> property allows you to get or set the current display mode. By handling the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayModeChanged" data-throw-if-not-resolved="false"></xref> routed event you would receive a notification whenever a change in the display mode occurs. <strong>Disabling or enabling the selection of dates</strong> can be controlled by the <xref href="Telerik.Windows.Controls.RadCalendar.SelectableDateStart" data-throw-if-not-resolved="false"></xref> and <xref href="Telerik.Windows.Controls.RadCalendar.SelectableDateEnd" data-throw-if-not-resolved="false"></xref> properties. If none of the latter two has been set, i.e. their value is <strong>null</strong> then all the <strong>calendar</strong> dates are selectable. The <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> property holds the <strong>DateTime</strong> value of the selected date. The default value is <strong>null</strong> (no date is selected). Adding a handler for the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> event would enable you to be notified whenever a date is selected. Similarly, to modify which dates the user can navigate to, use the DisplayDateStart and DisplayDateEnd properties. Setting the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDate" data-throw-if-not-resolved="false"></xref> property navigates the calendar to the month or year that contain this date (depending on the current <strong>DisplayMode</strong>). Please note that the DisplayDate property <strong>cannot be set to null</strong>. The Calendar has more than 20 properties which allow you to set styles, style selectors, templates and template selectors for the different views and buttons of the Calendar. The Calendar help articles provide more information on the control parts and template structures. Please note that the <strong>RadCalendar</strong> currently supports <strong>only Gregorian</strong> calendar.
Definition
Namespace:Telerik.Windows.Controls
Assembly:Telerik.Windows.Controls.Input.dll
Syntax:
[Themable]
[TelerikToolboxCategory("Input")]
public class RadCalendar : Control
Inheritance: objectRadCalendar
Constructors
Initializes a new instance of the RadCalendar class.
public RadCalendar()
Please refer to the <xref href="Telerik.Windows.Controls.RadCalendar" data-throw-if-not-resolved="false"></xref> information examples on how to use the control.
Fields
AreWeekNamesVisibleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty AreWeekNamesVisibleProperty
AreWeekNumbersVisibleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty AreWeekNumbersVisibleProperty
BlackoutDatesProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty BlackoutDatesProperty
CalendarWeekRuleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty CalendarWeekRuleProperty
CenturyViewHeaderFormatProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty CenturyViewHeaderFormatProperty
CenturyViewPanelProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty CenturyViewPanelProperty
CenturyViewStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty CenturyViewStyleProperty
ColumnsProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty ColumnsProperty
CultureProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty CultureProperty
DateSelectionModeProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DateSelectionModeProperty
DayButtonStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DayButtonStyleProperty
DayButtonStyleSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DayButtonStyleSelectorProperty
DayTemplateProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DayTemplateProperty
DayTemplateSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DayTemplateSelectorProperty
DecadeButtonStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DecadeButtonStyleProperty
DecadeButtonStyleSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DecadeButtonStyleSelectorProperty
DecadeTemplateProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DecadeTemplateProperty
DecadeTemplateSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DecadeTemplateSelectorProperty
DecadeViewHeaderFormatProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DecadeViewHeaderFormatProperty
DecadeViewPanelProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DecadeViewPanelProperty
DecadeViewStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DecadeViewStyleProperty
DisplayDateChangedEvent
RoutedEvent
Identifies the Event.
public static readonly RoutedEvent DisplayDateChangedEvent
DisplayDateEndProperty
DependencyProperty
Identifies the Property.
public static readonly DependencyProperty DisplayDateEndProperty
DisplayDateProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty DisplayDateProperty
DisplayDateStartProperty
DependencyProperty
Identifies the .
public static readonly DependencyProperty DisplayDateStartProperty
DisplayModeChangedEvent
RoutedEvent
Identifies the Event.
public static readonly RoutedEvent DisplayModeChangedEvent
DisplayModeProperty
DependencyProperty
Identifies the Property.
public static readonly DependencyProperty DisplayModeProperty
FirstDayOfWeekProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty FirstDayOfWeekProperty
HeaderVisibilityProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty HeaderVisibilityProperty
IsReadOnlyProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty IsReadOnlyProperty
IsTodayHighlightedProperty
DependencyProperty
Identifies the dependency property.
public static readonly DependencyProperty IsTodayHighlightedProperty
Gets the latest date that the calendar can display.
public static readonly DateTime MaxDate
Gets the earliest date that the calendar can display.
public static readonly DateTime MinDate
MonthButtonStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty MonthButtonStyleProperty
MonthButtonStyleSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty MonthButtonStyleSelectorProperty
MonthTemplateProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty MonthTemplateProperty
MonthTemplateSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty MonthTemplateSelectorProperty
MonthViewHeaderFormatProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty MonthViewHeaderFormatProperty
MonthViewPanelProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty MonthViewPanelProperty
MonthViewStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty MonthViewStyleProperty
NextButtonVisibilityProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty NextButtonVisibilityProperty
OrientationProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty OrientationProperty
PreviousButtonVisibilityProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty PreviousButtonVisibilityProperty
RowsProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty RowsProperty
SelectableDateEndProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty SelectableDateEndProperty
SelectableDateStartProperty
DependencyProperty
Identifies the dependency property.
public static readonly DependencyProperty SelectableDateStartProperty
SelectedDateProperty
DependencyProperty
Identifies the dependency property.
public static readonly DependencyProperty SelectedDateProperty
SelectionChangedEvent
RoutedEvent
Identifies the Event.
public static readonly RoutedEvent SelectionChangedEvent
SelectionModeProperty
DependencyProperty
Identifies the dependency property.
public static readonly DependencyProperty SelectionModeProperty
UseShortestDayNamesProperty
DependencyProperty
Identifies the property.
The value that indicates whether the week names buttons are using shortest day names.
It's used in office 2013 theme.
public static readonly DependencyProperty UseShortestDayNamesProperty
ViewsHeaderVisibilityProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty ViewsHeaderVisibilityProperty
YearButtonStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty YearButtonStyleProperty
YearButtonStyleSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty YearButtonStyleSelectorProperty
YearTemplateProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty YearTemplateProperty
YearTemplateSelectorProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty YearTemplateSelectorProperty
YearViewHeaderFormatProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty YearViewHeaderFormatProperty
YearViewPanelProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty YearViewPanelProperty
YearViewStyleProperty
DependencyProperty
Identifies the property.
public static readonly DependencyProperty YearViewStyleProperty
Properties
Gets or sets whether WeekNames will be displayed.
public bool AreWeekNamesVisible { get; set; }
Please note that if you hide the WeekNames would not automatically change the template of the calendar. Depending on the skin, you may need to change the template to visually make up for the fewer displayed elements. The <xref href="Telerik.Windows.Controls.RadCalendar.AreWeekNumbersVisible" data-throw-if-not-resolved="false"></xref> can also be hidden. The default value is true.
Gets or sets whether WeekNumbers will be displayed.
public bool AreWeekNumbersVisible { get; set; }
Please note that if you hide the WeekNumbers it would not automatically change the template of the calendar. Depending on the skin, you may need to change the template to visually make up for the fewer displayed elements. The <xref href="Telerik.Windows.Controls.RadCalendar.AreWeekNamesVisible" data-throw-if-not-resolved="false"></xref> can also be hidden. The default value is true.
Gets or sets a list of dates that cannot be selected. This is a dependency property.
public IEnumerable<DateTime> BlackoutDates { get; set; }
The <strong>BlackoutDates</strong> specifies a list of dates that cannot be selected by the user.
Gets or sets how should the first week in the year be counted. This is a dependency property.
public CalendarWeekRule? CalendarWeekRule { get; set; }
By default if no value is set (or is set to null), the CalendarWeek rule will be taken from Culture property (or InvariantCulture)'s DateTimeFormat.CalendarWeekRule.
Gets or sets the format for the header of the century views of the calendar. This is a dependency property.
public string CenturyViewHeaderFormat { get; set; }
The CenturyViewHeaderFormat is a DateTime format which will be used for the header of the CenturyView. If the property is set to null, a default format "yyyy" will be used.
CenturyViewPanel
ItemsPanelTemplate
Gets or sets the items panel template for the century views of the calendar. This is a dependency property.
public ItemsPanelTemplate CenturyViewPanel { get; set; }
CenturyViewStyle
Style
Gets or sets the style of the century calendar view. This is a dependency property.
public Style CenturyViewStyle { get; set; }
Gets or sets the number of columns of calendar views in the calendar. This is a dependency property.
public int Columns { get; set; }
The minimum value of the Columns property is one and the maximum is four.
Gets or sets the culture that the Calendar uses. This is a dependency property.
public CultureInfo Culture { get; set; }
Some of the elements in the Calendar are culture-specific, for example: The <strong>day/month names</strong>, rules for <strong>date formatting</strong>, the <xref href="Telerik.Windows.Controls.RadCalendar.FirstDayOfWeek" data-throw-if-not-resolved="false"></xref>, <xref href="Telerik.Windows.Controls.RadCalendar.CalendarWeekRule" data-throw-if-not-resolved="false"></xref>. Some more specific properties like <xref href="Telerik.Windows.Controls.RadCalendar.FirstDayOfWeek" data-throw-if-not-resolved="false"></xref> take precedence over the Culture property if they are set. If no Culture is specified, all the elements that rely on it will fall back to the <strong>CultureInfo.CurrentCulture</strong>. The default value is <strong>null</strong>.
Gets or sets DateSelectionMode property. This is a dependency property.
public DateSelectionMode DateSelectionMode { get; set; }
DayButtonStyle
Style
Gets or sets the style for the day buttons in the month views of the calendar. This is a dependency property.
public Style DayButtonStyle { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DayButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DayButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Day buttons in the Month CalendarView. For more information on styling, see the Calendar help articles.
DayButtonStyleSelector
StyleSelector
Gets or sets the style selector for the day buttons in the month views of the Calendar.
public StyleSelector DayButtonStyleSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DayButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DayButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Day buttons in the Month CalendarView. For more information on styling, see the Calendar help articles.
DayTemplate
DataTemplate
Gets or sets the content templates for the day buttons in the month views of the calendar. This is a dependency property.
public DataTemplate DayTemplate { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DayTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DayTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Day buttons in the Month CalendarView. For more information on styling, see the Calendar help articles.
DayTemplateSelector
DataTemplateSelector
Gets or sets the DataTemplate selectors for the day buttons in the month views of the calendar. This is a dependency property.
public DataTemplateSelector DayTemplateSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DayTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DayTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Day buttons in the Month CalendarView. For more information on styling, see the Calendar help articles.
DecadeButtonStyle
Style
Gets or sets the style for the year decade in the century views of the calendar. This is a dependency property.
public Style DecadeButtonStyle { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DecadeButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DecadeButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Day buttons in the Century CalendarView. For more information on styling, see the Calendar help articles.
DecadeButtonStyleSelector
StyleSelector
Gets or sets the style selector for the decade buttons in the century views of the Calendar.
public StyleSelector DecadeButtonStyleSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DecadeButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DecadeButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Day buttons in the Century CalendarView. For more information on styling, see the Calendar help articles.
DecadeTemplate
DataTemplate
Gets or sets the content templates for the decade buttons in the century views of the calendar. This is a dependency property.
public DataTemplate DecadeTemplate { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DecadeTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DecadeTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Decade buttons in the Century CalendarView. For more information on styling, see the Calendar help articles.
DecadeTemplateSelector
DataTemplateSelector
Gets or sets the DataTemplate selectors for the decade buttons in the century views of the calendar. This is a dependency property.
public DataTemplateSelector DecadeTemplateSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.DecadeTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.DecadeTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Decade buttons in the Century CalendarView. For more information on styling, see the Calendar help articles.
Gets or sets the format for the header of the decade views of the calendar. This is a dependency property.
public string DecadeViewHeaderFormat { get; set; }
The DecadeViewHeaderFormat is a DateTime format which will be used for the header of the DecadeView. If the property is set to null, a default format "yyyy" will be used.
DecadeViewPanel
ItemsPanelTemplate
Gets or sets the items panel template for the decade views of the calendar. This is a dependency property.
public ItemsPanelTemplate DecadeViewPanel { get; set; }
The DecadeView Panel specifies the panel that arranges the year buttons in the decade view. By default it is an UniformGrid with 3 rows and 4 columns. For more information on styling, see the Calendar help articles.
DecadeViewStyle
Style
Gets or sets the style of the decade calendar view. This is a dependency property.
public Style DecadeViewStyle { get; set; }
The decade view style specifies the style for the decade view. By setting the style every aspect of the CalendarView can be changed. For more information on styling, see the Calendar help articles.
Gets or sets the current date to display. This is a dependency property.
public DateTime DisplayDate { get; set; }
The <strong>DisplayDate</strong> property specifies the date to display in the <xref href="Telerik.Windows.Controls.RadCalendar" data-throw-if-not-resolved="false"></xref>. If no display date was set, then the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> is used. Alternatively, if no date is selected then <strong>DateTime.Today</strong> is used. Setting the display date does not affect the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayMode" data-throw-if-not-resolved="false"></xref> of the Calendar, e.g. if the <strong>DisplayMode</strong> is set to <strong>Year</strong> changing the DisplayDate within the same year would not change the view, while setting a DisplayDate of a different year would change the view. Similarly to the other date properties of the Calendar, the time part of the <strong>DateTime</strong> object is not only ignored but set to <strong>00:00:00</strong> as well. See <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> for an example and more information on that behavior. The <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateStart" data-throw-if-not-resolved="false"></xref> and <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateEnd" data-throw-if-not-resolved="false"></xref> properties defined a range within which the <strong>DisplayDate</strong> can be set, i.e. a range within which the user can navigate. If you try to set a <strong>DisplayDate outside the defined range</strong> an <strong>ArgumentOutOfRangeException</strong> would be thrown. Similarly, setting a display range that excludes the current DisplayDate would throw an exception. Changing the <strong>DisplayDate</strong> property fires the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateChanged" data-throw-if-not-resolved="false"></xref> event. Please note that unless the DisplayDate is changed from code the event would fire only when the displayed month or year actually changes, i.e. selecting a day within the currently viewed month would not fire the event (or change the property). Selecting a month while the DisplayMode is Year would fire the event if the month is different from the previously selected. Please note that unlike the other date properties <strong>DisplayDate cannot be set to null</strong>.
Gets or sets the last date that would be able to be displayed. This is a dependency property.
public DateTime? DisplayDateEnd { get; set; }
The <strong>DisplayDateEnd</strong> property can limit the dates which can be navigated to. The <strong>DisplayDateEnd</strong> is the date furthest away in time that can be displayed. Setting the property to <strong>null</strong> would enable all dates to be viewed. Please note that <strong>ArgumentOutOfRange</strong> exception would be thrown if the <strong>DisplayDateEnd</strong> is set to a date earlier than the currently displayed date (<xref href="Telerik.Windows.Controls.RadCalendar.DisplayDate" data-throw-if-not-resolved="false"></xref>). More information about setting the displayable dates' range and an example can be found on the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateStart" data-throw-if-not-resolved="false"></xref> help page.
Gets or sets the first date that would be able to be displayed. This is a dependency property.
public DateTime? DisplayDateStart { get; set; }
The <strong>DisplayDateStart</strong> property together with <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateEnd" data-throw-if-not-resolved="false"></xref> allows you to define a range within which the user would be able to navigate. The <strong>DisplayDateStart</strong> does not affect whether a date can be selected or not. Please refer to <xref href="Telerik.Windows.Controls.RadCalendar.SelectableDateStart" data-throw-if-not-resolved="false"></xref> for more information on controlling selection. For example setting the <strong>DisplayDateStart</strong> to <strong>DateTime.Today</strong> would ensure that the <strong>Calendar</strong> would not be able to navigate to the previous month or year but changing the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayMode" data-throw-if-not-resolved="false"></xref> or selecting dates from the current month is unaffected. Similarly to the other date properties of the Calendar, the time part of the <strong>DateTime</strong> object is not only ignored but set to <strong>00:00:00</strong> as well (coerced). See <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> for an example and more information on that behavior. Setting the <strong>DisplayDateStart</strong> to <strong>null</strong> means that <strong>DateTime.MinValue</strong> would be the start of the displayable range. The default values is null.
Gets or sets the display mode of the Calendar. This is a dependency property.
public DisplayMode DisplayMode { get; set; }
The <strong>DisplayMode</strong> property controls the span of time the calendar is currently displaying: month, year, decade and century. The display mode can be changed by clicking the calendar header between the previous and next buttons and by choosing from the list of months/years/decades. Alternatively the DisplayMode can be changed programmatically although this is not recommended since this may contradict user expectations.
- CalendarMode.Month: The Calendar displays a month, days from the previous or next months can also be visible but are visually differentiated and clicking them would navigate to the respective month. The names of the days are localized according to the current thread culture.
- CalendarMode.Year: The Calendar displays a year - twelve buttons with the localized names of the months. The current thread culture is used for the localization.
- CalendarMode.Decade: The Calendar displays a decade - twelve years, starting from a year before the chosen decade and ending a year after it.
- CalendarMode.Century: The Calendar displays a century with twelve calendar buttons.
The <xref href="Telerik.Windows.Controls.RadCalendar.DisplayModeChanged" data-throw-if-not-resolved="false"></xref> event is fired when the property changes. The <xref href="Telerik.Windows.Controls.Calendar.CalendarModeChangedEventArgs" data-throw-if-not-resolved="false"></xref> provide the old and new value of the display mode. An example where the event is used can be found on the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> help page.
Gets or sets the day that is considered the beginning of the week.
public DayOfWeek? FirstDayOfWeek { get; set; }
The <strong>FirstDayOfWeek</strong> property specifies which is the day in the leftmost column of the calendar view, i.e. which is the first day of the week. If the property is set to <strong>null</strong>, the <xref href="Telerik.Windows.Controls.RadCalendar.Culture" data-throw-if-not-resolved="false"></xref> will be checked, if a specific culture is set, its FirstDayOfWeek is considered. Otherwise the <strong>CurrentCulture</strong> will be used. Generally, the start of the week varies with different cultures so if you would like the <strong>Calendar</strong> to display the dates as you see them, be sure to set the FirstDayOfWeek property or the <xref href="Telerik.Windows.Controls.RadCalendar.Culture" data-throw-if-not-resolved="false"></xref> property.csharpcalendar.FirstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
HeaderVisibility
Visibility
Gets or sets the visibility of the Calendar's header. This is a dependency property.
public Visibility HeaderVisibility { get; set; }
The header of the calendar is the area on the top in which the Header Button and the Previous and NextButtons reside. To make the buttons invisible, but still have a header, you can set the HeaderVisibility to <strong>Collapsed</strong> and <xref href="Telerik.Windows.Controls.RadCalendar.ViewsHeaderVisibility" data-throw-if-not-resolved="false"></xref> to <strong>Visible</strong>.
Gets or sets whether the Calendar's selection can be changed. This is a dependency property.
public bool IsReadOnly { get; set; }
The <strong>IsReadOnly</strong> property specifies whether the current selection can be changed. Please note that the IsReadOnly property governs user interaction, i.e. the selected dates can be changed programmatically - through a binding or setting the SelectedDate(s) properties. To disable all the interaction with the Calendar, use the <strong>IsEnabled</strong> property.
Gets or sets whether the today date would be highlighted. This is a dependency property.
public bool IsTodayHighlighted { get; set; }
The <strong>IsTodayHighlighted</strong> property indicates whether the today date in the calendar would be highlighted. The <strong>default value is true</strong>. Please note that the <strong>IsTodayHighlighted</strong> property does not affect whether the today date is selected or not. Use the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> or <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDates" data-throw-if-not-resolved="false"></xref> properties to specify the selected date(s).
MonthButtonStyle
Style
Gets or sets the style for the month buttons in the year views of the calendar. This is a dependency property.
public Style MonthButtonStyle { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.MonthButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.MonthButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Month buttons in the Year CalendarView. For more information on styling, see the Calendar help articles.
MonthButtonStyleSelector
StyleSelector
Gets or sets the style selector for the month buttons in the year views of the Calendar.
public StyleSelector MonthButtonStyleSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.MonthButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.MonthButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Month buttons in the Year CalendarView. For more information on styling, see the Calendar help articles.
MonthTemplate
DataTemplate
Gets or sets the content templates for the month buttons in the year views of the calendar. This is a dependency property.
public DataTemplate MonthTemplate { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.MonthTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.MonthTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Month buttons in the Year CalendarView. For more information on styling, see the Calendar help articles.
MonthTemplateSelector
DataTemplateSelector
Gets or sets the DataTemplate selectors for the month buttons in the year views of the calendar. This is a dependency property.
public DataTemplateSelector MonthTemplateSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.MonthTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.MonthTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Month buttons in the Year CalendarView. For more information on styling, see the Calendar help articles.
Gets or sets the format for the header of the month views of the calendar. This is a dependency property.
public string MonthViewHeaderFormat { get; set; }
The MonthViewHeaderFormat is a DateTime format which will be used for the header of the MonthView. If the property is set to null, a default format "MMMM' - 'yyyy" will be used.
MonthViewPanel
ItemsPanelTemplate
Gets or sets the items panel template for the month views of the calendar. This is a dependency property.
public ItemsPanelTemplate MonthViewPanel { get; set; }
The MonthView Panel specifies the panel that arranges the day buttons in the month view. By default it is an UniformGrid with 7 rows and 8 columns. For more information on styling, see the Calendar help articles.
MonthViewStyle
Style
Gets or sets the style of the month calendar view. This is a dependency property.
public Style MonthViewStyle { get; set; }
The month view style specifies the style for the month view. By setting the style every aspect of the CalendarView can be changed. For more information on styling, see the Calendar help articles.
NextButtonVisibility
Visibility
Gets or sets the visibility of the Calendar's MoveRight button. This is a dependency property.
public Visibility NextButtonVisibility { get; set; }
The MoveRight button of the calendar is in the area on the top in which the Header Button and the PreviousButton reside.
Orientation
Orientation
Gets or sets whether the orientation of the Calendar. This is a dependency property.
public Orientation Orientation { get; set; }
The <strong>Orientation</strong> property specifies how should the dates be arranged with regard to the position of the Week Names and Week Numbers. When the orientation is <strong>Horizontal</strong>, the <strong>WeekNames appear on top</strong>, horizontally while the <strong>week numbers are a column</strong> on the left. If the Orientation is <strong>Vertical</strong>, the <strong>WeekNames are arranged in a Column</strong> on the left, and the <strong>numbers are a row</strong> on the top. The default value is Horizontal.
PreviousButtonVisibility
Visibility
Gets or sets the visibility of the Calendar's MoveLeft button. This is a dependency property.
public Visibility PreviousButtonVisibility { get; set; }
The MoveLeft button of the calendar is in the area on the top in which the Header Button and the NextButton reside.
Gets or sets the number of rows of calendar views in the calendar. This is a dependency property.
public int Rows { get; set; }
When there is more than one calendar view present, the <xref href="Telerik.Windows.Controls.RadCalendar.ViewsHeaderVisibility" data-throw-if-not-resolved="false"></xref> may make identifying the different months/years easier. The minimum value of the Rows property is one and the maximum is four.
Gets or sets the last date that can be selected. This is a dependency property.
public DateTime? SelectableDateEnd { get; set; }
The <strong>SelectableDateEnd</strong> specifies the last date that can be selected by the user. Please note that the SelectableDateEnd should not be set to a date larger than the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateEnd" data-throw-if-not-resolved="false"></xref> or <xref href="Telerik.Windows.Controls.RadCalendar.MaxDate" data-throw-if-not-resolved="false"></xref>. The SelectableDate end cannot be set to a date smaller than the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref>. To specify the range of dates that will be visible to the users, use <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateStart" data-throw-if-not-resolved="false"></xref> and <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateEnd" data-throw-if-not-resolved="false"></xref>.
Gets or sets the first date that can be selected. This is a dependency property.
public DateTime? SelectableDateStart { get; set; }
The <strong>SelectableDateStart</strong> specifies the first date that can be selected by the user. Please note that the SelectableDateStart should not be set to a date larger than the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref>. The SelectableDate end cannot be set to a date smaller than the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateStart" data-throw-if-not-resolved="false"></xref> or <xref href="Telerik.Windows.Controls.RadCalendar.MinDate" data-throw-if-not-resolved="false"></xref> To specify the range of dates that will be visible to the users, use <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateStart" data-throw-if-not-resolved="false"></xref> and <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDateEnd" data-throw-if-not-resolved="false"></xref>.
Gets or sets the currently selected date. This is a dependency property.
public DateTime? SelectedDate { get; set; }
The <strong>SelectedDate</strong> property identifies the last date that has been selected. If more than one date needs to be selected, please see the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDates" data-throw-if-not-resolved="false"></xref> property. Setting the <strong>SelectedDate</strong> property to <strong>null</strong> would deselect any selection. The <strong>default value is null</strong>. Selecting a date fires the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> event. An example about handling events is provided below. Please note that the user would not be able to select dates outside the <strong>SelectableDates</strong> range defined by the <xref href="Telerik.Windows.Controls.RadCalendar.SelectableDateStart" data-throw-if-not-resolved="false"></xref> and <xref href="Telerik.Windows.Controls.RadCalendar.SelectableDateEnd" data-throw-if-not-resolved="false"></xref> properties. Note that all <strong>DateTime</strong> properties of the <strong>RadCalendar</strong> discard the time of the DateTime object, i.e. the <strong>time is coerced to 0:0:0</strong>.
Gets an list of the currently selected dates.
public IList<DateTime> SelectedDates { get; }
The <strong>SelectedDates</strong> collection is an <strong>observable collection</strong> (although it is exposed as an IList) which contains the currently selected dates and can be used in binding. In Single SelectionMode the collection would still be populated with the selected date (if any). Just as with <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref>, all the dates in the collection will be coerced and should be between the SelectableDateStart/End and DisplayDateStart/End.
SelectionMode
SelectionMode
Gets or sets the types of selection that would be allowed in the Calendar. This is a dependency property.
public SelectionMode SelectionMode { get; set; }
The Selection mode in the Calendar works very much like the SelectionMode in a ListBox.
Selection across several months is possible, either by navigating to a different month and selecting dates there or by displaying more than one months at a time (See <xref href="Telerik.Windows.Controls.RadCalendar.Rows" data-throw-if-not-resolved="false"></xref> and <xref href="Telerik.Windows.Controls.RadCalendar.Columns" data-throw-if-not-resolved="false"></xref> properties). The default value is Single.
ViewsHeaderVisibility
Visibility
Gets or sets the visibility of the header of the calendar views (month, year, decade, century). This is a dependency property.
public Visibility ViewsHeaderVisibility { get; set; }
When multi-view calendar is used (the <xref href="Telerik.Windows.Controls.RadCalendar.Rows" data-throw-if-not-resolved="false"></xref> and <xref href="Telerik.Windows.Controls.RadCalendar.Columns" data-throw-if-not-resolved="false"></xref> properties have been set) showing the CalendarViews headers helps the specific views to be identified. For example if 4 months are visible, headers would appear on top of each month and not just the calendar header. The default value is Collapsed.
YearButtonStyle
Style
Gets or sets the style for the year buttons in the decade views of the calendar. This is a dependency property.
public Style YearButtonStyle { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.YearButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.YearButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Year buttons in the Decade CalendarView. For more information on styling, see the Calendar help articles.
YearButtonStyleSelector
StyleSelector
Gets or sets the style selector for the year buttons in the decade views of the Calendar.
public StyleSelector YearButtonStyleSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.YearButtonStyleSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.YearButtonStyle" data-throw-if-not-resolved="false"></xref> specify the Style of the Year buttons in the Decade CalendarView. For more information on styling, see the Calendar help articles.
YearTemplate
DataTemplate
Gets or sets the content templates for the year buttons in the decade views of the calendar. This is a dependency property.
public DataTemplate YearTemplate { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.YearTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.YearTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Year buttons in the Decade CalendarView. For more information on styling, see the Calendar help articles.
YearTemplateSelector
DataTemplateSelector
Gets or sets the DataTemplate selectors for the year buttons in the decade views of the calendar. This is a dependency property.
public DataTemplateSelector YearTemplateSelector { get; set; }
The <xref href="Telerik.Windows.Controls.RadCalendar.YearTemplateSelector" data-throw-if-not-resolved="false"></xref> together with the <xref href="Telerik.Windows.Controls.RadCalendar.YearTemplate" data-throw-if-not-resolved="false"></xref> specify the DataTemplate of the Year buttons in the Decade CalendarView. For more information on styling, see the Calendar help articles.
Gets or sets the format for the header of the year views of the calendar. This is a dependency property.
public string YearViewHeaderFormat { get; set; }
The YearViewHeaderFormat is a DateTime format which will be used for the header of the YearView. If the property is set to null, a default format "yyyy" will be used.
YearViewPanel
ItemsPanelTemplate
Gets or sets the items panel template for the year views of the calendar. This is a dependency property.
public ItemsPanelTemplate YearViewPanel { get; set; }
The YearView Panel specifies the panel that arranges the month buttons in the year view. By default it is an UniformGrid with 3 rows and 4 columns. For more information on styling, see the Calendar help articles.
YearViewStyle
Style
Gets or sets the style of the calendar year view. This is a dependency property.
public Style YearViewStyle { get; set; }
The year view style specifies the style for the year view. By setting the style every aspect of the CalendarView can be changed. For more information on styling, see the Calendar help articles.
Methods
Checks whether the date is a valid DisplayDateEnd value for the given calendar.
public static bool IsDisplayDateEndValid(RadCalendar calendar, DateTime? newDisplayDateEnd)
The calendar for which to test the value.
newDisplayDateEndDateTime?The date to test.
Returns:True if it is a valid display date end, false otherwise.
Checks whether the date is a valid DisplayDateStart value for the given calendar.
public static bool IsDisplayDateStartValid(RadCalendar calendar, DateTime? newDisplayDate)
The calendar for which to test the value.
newDisplayDateDateTime?The date to test.
Returns:True if it is a valid display date start, false otherwise.
Checks whether the given date is a valid display date for the calendar.
public static bool IsDisplayDateValid(RadCalendar calendar, DateTime newDisplayDate)
The calendar to check the display date for.
newDisplayDateDateTimeThe new display date to test.
Returns:True if it is a valid display date, false otherwise.
Checks whether the date is a valid SelectableDateEnd value for the given calendar.
public static bool IsSelectableDateEndValid(RadCalendar calendar, DateTime? newSelectableDateEnd)
The calendar to test for.
newSelectableDateEndDateTime?The date to test.
Returns:True if it is a valid selectable date end, false otherwise.
Checks whether the date is a valid SelectableDateStart value for the given calendar.
public static bool IsSelectableDateStartValid(RadCalendar calendar, DateTime? newSelectableDateStart)
The calendar to test for.
newSelectableDateStartDateTime?The date to test.
Returns:True if it is a valid selectable date start, false otherwise.
When overridden in a derived class, is invoked whenever application code or internal processes call .
public override void OnApplyTemplate()
Called when BlackoutDates collection changed.
protected virtual void OnBlackOutDatesChanged(IEnumerable<DateTime> oldCollection, IEnumerable<DateTime> newCollection)
The old value.
newCollectionIEnumerable<DateTime>The new value.
Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
AutomationPeer
The OnDisplayDateChanged is called when the display date of the calendar changes.
protected virtual void OnDisplayDateChanged(CalendarDateChangedEventArgs e)
The parameter contains the new and the old display dates.
OnDisplayModeChanged is called when the display mode of the calendar changes.
protected virtual void OnDisplayModeChanged(CalendarModeChangedEventArgs e)
The parameter contains the old and the new display modes.
Called before the System.Windows.UIElement.GotFocus event occurs.
protected override void OnGotFocus(RoutedEventArgs e)
The data for the event.
Raises the event. This method is invoked whenever is set to true internally.
protected override void OnInitialized(EventArgs e)
The RoutedEventArgs that contains the event data.
Called before the event occurs.
protected override void OnKeyDown(KeyEventArgs e)
The data for the event.
Called before the event occurs.
protected override void OnMouseLeave(MouseEventArgs e)
The data for the event.
Called before the event occurs.
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
The data for the event.
OnSelectionChanged is called whenever the selected dates of the calendar change.
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameter that describes how the selection has changed.
Called when SelectionMode changed.
protected virtual void OnSelectionModeChanged(SelectionMode oldValue, SelectionMode newValue)
The old value.
newValueSelectionModeThe new value.
Resets the theme.
public void ResetTheme()
Events
Occurs when the DisplayDate property is changed.
public event EventHandler<CalendarDateChangedEventArgs> DisplayDateChanged
The <strong>DisplayDateChanged</strong> event is fired when the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDate" data-throw-if-not-resolved="false"></xref> property of the calendar changes. For more information on the event go to the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDate" data-throw-if-not-resolved="false"></xref> help article.
Occurs when the DisplayMode property is changed.
public event EventHandler<CalendarModeChangedEventArgs> DisplayModeChanged
The <strong>DisplayModeChanged</strong> event is fired when the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayDate" data-throw-if-not-resolved="false"></xref> property changes. For more information please go to the <xref href="Telerik.Windows.Controls.RadCalendar.DisplayMode" data-throw-if-not-resolved="false"></xref> article.
SelectionChanged
SelectionChangedEventHandler
Occurs when a date is selected.
public event SelectionChangedEventHandler SelectionChanged
The <strong>DateSelected</strong> event is fired when the <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDate" data-throw-if-not-resolved="false"></xref> or <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDates" data-throw-if-not-resolved="false"></xref> have changed. The DateSelected is designed to be used in single selection mode. For more information on handling events in multiple selection mode, please refer to <xref href="Telerik.Windows.Controls.RadCalendar.SelectedDates" data-throw-if-not-resolved="false"></xref> help article.