New to Telerik UI for WPFStart a free 30-day trial

Represents a selection control that allows you to select dates from a calendar.

Definition

Namespace:Telerik.Windows.Controls

Assembly:Telerik.Windows.Controls.Input.dll

Syntax:

C#
[Themable]
[TelerikToolboxCategory("Input")]
public class RadCalendar : Control

Inheritance: objectRadCalendar

Constructors

Initializes a new instance of the RadCalendar class.

C#
public RadCalendar()
Remarks:

Please refer to the RadCalendar information examples on how to use the control.

Fields

AreWeekNamesVisibleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty AreWeekNamesVisibleProperty

Identifies the property.

C#
public static readonly DependencyProperty AreWeekNumbersVisibleProperty

BlackoutDatesProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty BlackoutDatesProperty

CalendarWeekRuleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty CalendarWeekRuleProperty

Identifies the property.

C#
public static readonly DependencyProperty CenturyViewHeaderFormatProperty

CenturyViewPanelProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty CenturyViewPanelProperty

CenturyViewStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty CenturyViewStyleProperty

ColumnsProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty ColumnsProperty

CultureProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty CultureProperty

DateSelectionModeProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DateSelectionModeProperty

DayButtonStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DayButtonStyleProperty

Identifies the property.

C#
public static readonly DependencyProperty DayButtonStyleSelectorProperty

DayTemplateProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DayTemplateProperty

DayTemplateSelectorProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DayTemplateSelectorProperty

DecadeButtonStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DecadeButtonStyleProperty

Identifies the property.

C#
public static readonly DependencyProperty DecadeButtonStyleSelectorProperty

DecadeTemplateProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DecadeTemplateProperty

Identifies the property.

C#
public static readonly DependencyProperty DecadeTemplateSelectorProperty

Identifies the property.

C#
public static readonly DependencyProperty DecadeViewHeaderFormatProperty

DecadeViewPanelProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DecadeViewPanelProperty

DecadeViewStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DecadeViewStyleProperty

Identifies the Event.

C#
public static readonly RoutedEvent DisplayDateChangedEvent

DisplayDateEndProperty

DependencyProperty

Identifies the Property.

C#
public static readonly DependencyProperty DisplayDateEndProperty

DisplayDateProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty DisplayDateProperty

DisplayDateStartProperty

DependencyProperty

Identifies the .

C#
public static readonly DependencyProperty DisplayDateStartProperty

Identifies the Event.

C#
public static readonly RoutedEvent DisplayModeChangedEvent

DisplayModeProperty

DependencyProperty

Identifies the Property.

C#
public static readonly DependencyProperty DisplayModeProperty

FirstDayOfWeekProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty FirstDayOfWeekProperty

HeaderVisibilityProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty HeaderVisibilityProperty

IsReadOnlyProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty IsReadOnlyProperty

IsTodayHighlightedProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty IsTodayHighlightedProperty

Gets the latest date that the calendar can display.

C#
public static readonly DateTime MaxDate

Gets the earliest date that the calendar can display.

C#
public static readonly DateTime MinDate

MonthButtonStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty MonthButtonStyleProperty

Identifies the property.

C#
public static readonly DependencyProperty MonthButtonStyleSelectorProperty

MonthTemplateProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty MonthTemplateProperty

Identifies the property.

C#
public static readonly DependencyProperty MonthTemplateSelectorProperty

Identifies the property.

C#
public static readonly DependencyProperty MonthViewHeaderFormatProperty

MonthViewPanelProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty MonthViewPanelProperty

MonthViewStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty MonthViewStyleProperty

Identifies the property.

C#
public static readonly DependencyProperty NextButtonVisibilityProperty

OrientationProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty OrientationProperty

Identifies the property.

C#
public static readonly DependencyProperty PreviousButtonVisibilityProperty

RowsProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty RowsProperty

SelectableDateEndProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty SelectableDateEndProperty

SelectableDateStartProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty SelectableDateStartProperty

SelectedDateProperty

DependencyProperty

Identifies the dependency property.

C#
public static readonly DependencyProperty SelectedDateProperty

Identifies the Event.

C#
public static readonly RoutedEvent SelectionChangedEvent

SelectionModeProperty

DependencyProperty

Identifies the dependency property.

C#
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.

C#
public static readonly DependencyProperty UseShortestDayNamesProperty

Identifies the property.

C#
public static readonly DependencyProperty ViewsHeaderVisibilityProperty

YearButtonStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty YearButtonStyleProperty

Identifies the property.

C#
public static readonly DependencyProperty YearButtonStyleSelectorProperty

YearTemplateProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty YearTemplateProperty

Identifies the property.

C#
public static readonly DependencyProperty YearTemplateSelectorProperty

Identifies the property.

C#
public static readonly DependencyProperty YearViewHeaderFormatProperty

YearViewPanelProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty YearViewPanelProperty

YearViewStyleProperty

DependencyProperty

Identifies the property.

C#
public static readonly DependencyProperty YearViewStyleProperty

Properties

Gets or sets whether WeekNames will be displayed.

C#
public bool AreWeekNamesVisible { get; set; }
Remarks:

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 AreWeekNumbersVisible can also be hidden.

The default value is true.

Gets or sets whether WeekNumbers will be displayed.

C#
public bool AreWeekNumbersVisible { get; set; }
Remarks:

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 AreWeekNamesVisible 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.

C#
public IEnumerable<DateTime> BlackoutDates { get; set; }
Remarks:

The BlackoutDates 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.

C#
public CalendarWeekRule? CalendarWeekRule { get; set; }
Remarks:

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.

C#
public string CenturyViewHeaderFormat { get; set; }
Remarks:

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.

C#
public ItemsPanelTemplate CenturyViewPanel { get; set; }

Gets or sets the style of the century calendar view. This is a dependency property.

C#
public Style CenturyViewStyle { get; set; }

Gets or sets the number of columns of calendar views in the calendar. This is a dependency property.

C#
public int Columns { get; set; }
Remarks:

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.

C#
public CultureInfo Culture { get; set; }
Remarks:

Some of the elements in the Calendar are culture-specific, for example: The day/month names, rules for date formatting, the FirstDayOfWeek, CalendarWeekRule. Some more specific properties like FirstDayOfWeek 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 CultureInfo.CurrentCulture.

The default value is null.

Gets or sets DateSelectionMode property. This is a dependency property.

C#
public DateSelectionMode DateSelectionMode { get; set; }

Gets or sets the style for the day buttons in the month views of the calendar. This is a dependency property.

C#
public Style DayButtonStyle { get; set; }
Remarks:

The DayButtonStyleSelector together with the DayButtonStyle specify the Style of the Day buttons in the Month CalendarView.

For more information on styling, see the Calendar help articles.

Gets or sets the style selector for the day buttons in the month views of the Calendar.

C#
public StyleSelector DayButtonStyleSelector { get; set; }
Remarks:

The DayButtonStyleSelector together with the DayButtonStyle 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.

C#
public DataTemplate DayTemplate { get; set; }
Remarks:

The DayTemplateSelector together with the DayTemplate 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.

C#
public DataTemplateSelector DayTemplateSelector { get; set; }
Remarks:

The DayTemplateSelector together with the DayTemplate specify the DataTemplate of the Day buttons in the Month CalendarView.

For more information on styling, see the Calendar help articles.

Gets or sets the style for the year decade in the century views of the calendar. This is a dependency property.

C#
public Style DecadeButtonStyle { get; set; }
Remarks:

The DecadeButtonStyleSelector together with the DecadeButtonStyle specify the Style of the Day buttons in the Century CalendarView.

For more information on styling, see the Calendar help articles.

Gets or sets the style selector for the decade buttons in the century views of the Calendar.

C#
public StyleSelector DecadeButtonStyleSelector { get; set; }
Remarks:

The DecadeButtonStyleSelector together with the DecadeButtonStyle 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.

C#
public DataTemplate DecadeTemplate { get; set; }
Remarks:

The DecadeTemplateSelector together with the DecadeTemplate 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.

C#
public DataTemplateSelector DecadeTemplateSelector { get; set; }
Remarks:

The DecadeTemplateSelector together with the DecadeTemplate 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.

C#
public string DecadeViewHeaderFormat { get; set; }
Remarks:

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.

C#
public ItemsPanelTemplate DecadeViewPanel { get; set; }
Remarks:

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.

Gets or sets the style of the decade calendar view. This is a dependency property.

C#
public Style DecadeViewStyle { get; set; }
Remarks:

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.

C#
public DateTime DisplayDate { get; set; }
Remarks:

The DisplayDate property specifies the date to display in the RadCalendar. If no display date was set, then the SelectedDate is used. Alternatively, if no date is selected then DateTime.Today is used.

Setting the display date does not affect the DisplayMode of the Calendar, e.g. if the DisplayMode is set to Year 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 DateTime object is not only ignored but set to 00:00:00 as well. See SelectedDate for an example and more information on that behavior.

The DisplayDateStart and DisplayDateEnd properties defined a range within which the DisplayDate can be set, i.e. a range within which the user can navigate. If you try to set a DisplayDate outside the defined range an ArgumentOutOfRangeException would be thrown. Similarly, setting a display range that excludes the current DisplayDate would throw an exception.

Changing the DisplayDate property fires the DisplayDateChanged 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 DisplayDate cannot be set to null.

Gets or sets the last date that would be able to be displayed. This is a dependency property.

C#
public DateTime? DisplayDateEnd { get; set; }
Remarks:

The DisplayDateEnd property can limit the dates which can be navigated to. The DisplayDateEnd is the date furthest away in time that can be displayed. Setting the property to null would enable all dates to be viewed.

Please note that ArgumentOutOfRange exception would be thrown if the DisplayDateEnd is set to a date earlier than the currently displayed date (DisplayDate).

More information about setting the displayable dates' range and an example can be found on the DisplayDateStart help page.

Gets or sets the first date that would be able to be displayed. This is a dependency property.

C#
public DateTime? DisplayDateStart { get; set; }
Remarks:

The DisplayDateStart property together with DisplayDateEnd allows you to define a range within which the user would be able to navigate. The DisplayDateStart does not affect whether a date can be selected or not. Please refer to SelectableDateStart for more information on controlling selection.

For example setting the DisplayDateStart to DateTime.Today would ensure that the Calendar would not be able to navigate to the previous month or year but changing the DisplayMode or selecting dates from the current month is unaffected.

Similarly to the other date properties of the Calendar, the time part of the DateTime object is not only ignored but set to 00:00:00 as well (coerced). See SelectedDate for an example and more information on that behavior.

Setting the DisplayDateStart to null means that DateTime.MinValue 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.

C#
public DisplayMode DisplayMode { get; set; }
Remarks:

The DisplayMode 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 DisplayModeChanged event is fired when the property changes. The CalendarModeChangedEventArgs provide the old and new value of the display mode. An example where the event is used can be found on the SelectedDate help page.

Gets or sets the day that is considered the beginning of the week.

C#
public DayOfWeek? FirstDayOfWeek { get; set; }

The FirstDayOfWeek 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 null, the Culture will be checked, if a specific culture is set, its FirstDayOfWeek is considered. Otherwise the CurrentCulture will be used.

Generally, the start of the week varies with different cultures so if you would like the Calendar to display the dates as you see them, be sure to set the FirstDayOfWeek property or the Culture property.

<pre><code class="lang-csharp">calendar.FirstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;</code></pre>

Gets or sets the visibility of the Calendar's header. This is a dependency property.

C#
public Visibility HeaderVisibility { get; set; }
Remarks:

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 Collapsed and ViewsHeaderVisibility to Visible.

Gets or sets whether the Calendar's selection can be changed. This is a dependency property.

C#
public bool IsReadOnly { get; set; }
Remarks:

The IsReadOnly 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 IsEnabled property.

Gets or sets whether the today date would be highlighted. This is a dependency property.

C#
public bool IsTodayHighlighted { get; set; }
Remarks:

The IsTodayHighlighted property indicates whether the today date in the calendar would be highlighted. The default value is true.

Please note that the IsTodayHighlighted property does not affect whether the today date is selected or not. Use the SelectedDate or SelectedDates properties to specify the selected date(s).

Gets or sets the style for the month buttons in the year views of the calendar. This is a dependency property.

C#
public Style MonthButtonStyle { get; set; }
Remarks:

The MonthButtonStyleSelector together with the MonthButtonStyle specify the Style of the Month buttons in the Year CalendarView.

For more information on styling, see the Calendar help articles.

Gets or sets the style selector for the month buttons in the year views of the Calendar.

C#
public StyleSelector MonthButtonStyleSelector { get; set; }
Remarks:

The MonthButtonStyleSelector together with the MonthButtonStyle 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.

C#
public DataTemplate MonthTemplate { get; set; }
Remarks:

The MonthTemplateSelector together with the MonthTemplate 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.

C#
public DataTemplateSelector MonthTemplateSelector { get; set; }
Remarks:

The MonthTemplateSelector together with the MonthTemplate 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.

C#
public string MonthViewHeaderFormat { get; set; }
Remarks:

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.

C#
public ItemsPanelTemplate MonthViewPanel { get; set; }
Remarks:

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.

Gets or sets the style of the month calendar view. This is a dependency property.

C#
public Style MonthViewStyle { get; set; }
Remarks:

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.

Gets or sets the visibility of the Calendar's MoveRight button. This is a dependency property.

C#
public Visibility NextButtonVisibility { get; set; }
Remarks:

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.

C#
public Orientation Orientation { get; set; }
Remarks:

The Orientation property specifies how should the dates be arranged with regard to the position of the Week Names and Week Numbers. When the orientation is Horizontal, the WeekNames appear on top, horizontally while the week numbers are a column on the left. If the Orientation is Vertical, the WeekNames are arranged in a Column on the left, and the numbers are a row on the top.

The default value is Horizontal.

Gets or sets the visibility of the Calendar's MoveLeft button. This is a dependency property.

C#
public Visibility PreviousButtonVisibility { get; set; }
Remarks:

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.

C#
public int Rows { get; set; }
Remarks:

When there is more than one calendar view present, the ViewsHeaderVisibility 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.

C#
public DateTime? SelectableDateEnd { get; set; }
Remarks:

The SelectableDateEnd 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 DisplayDateEnd or MaxDate. The SelectableDate end cannot be set to a date smaller than the SelectedDate.

To specify the range of dates that will be visible to the users, use DisplayDateStart and DisplayDateEnd.

Gets or sets the first date that can be selected. This is a dependency property.

C#
public DateTime? SelectableDateStart { get; set; }
Remarks:

The SelectableDateStart 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 SelectedDate. The SelectableDate end cannot be set to a date smaller than the DisplayDateStart or MinDate

To specify the range of dates that will be visible to the users, use DisplayDateStart and DisplayDateEnd.

Gets or sets the currently selected date. This is a dependency property.

C#
public DateTime? SelectedDate { get; set; }
Remarks:

The SelectedDate property identifies the last date that has been selected. If more than one date needs to be selected, please see the SelectedDates property.

Setting the SelectedDate property to null would deselect any selection. The default value is null.

Selecting a date fires the SelectedDate event. An example about handling events is provided below.

Please note that the user would not be able to select dates outside the SelectableDates range defined by the SelectableDateStart and SelectableDateEnd properties.

Note that all DateTime properties of the RadCalendar discard the time of the DateTime object, i.e. the time is coerced to 0:0:0.

Gets an list of the currently selected dates.

C#
public IList<DateTime> SelectedDates { get; }
Remarks:

The SelectedDates collection is an observable collection (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 SelectedDate, 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.

C#
public SelectionMode SelectionMode { get; set; }
Remarks:

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 Rows and Columns properties).

The default value is Single.

Gets or sets the visibility of the header of the calendar views (month, year, decade, century). This is a dependency property.

C#
public Visibility ViewsHeaderVisibility { get; set; }
Remarks:

When multi-view calendar is used (the Rows and Columns 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.

Gets or sets the style for the year buttons in the decade views of the calendar. This is a dependency property.

C#
public Style YearButtonStyle { get; set; }
Remarks:

The YearButtonStyleSelector together with the YearButtonStyle specify the Style of the Year buttons in the Decade CalendarView.

For more information on styling, see the Calendar help articles.

Gets or sets the style selector for the year buttons in the decade views of the Calendar.

C#
public StyleSelector YearButtonStyleSelector { get; set; }
Remarks:

The YearButtonStyleSelector together with the YearButtonStyle 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.

C#
public DataTemplate YearTemplate { get; set; }
Remarks:

The YearTemplateSelector together with the YearTemplate 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.

C#
public DataTemplateSelector YearTemplateSelector { get; set; }
Remarks:

The YearTemplateSelector together with the YearTemplate 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.

C#
public string YearViewHeaderFormat { get; set; }
Remarks:

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.

C#
public ItemsPanelTemplate YearViewPanel { get; set; }
Remarks:

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.

Gets or sets the style of the calendar year view. This is a dependency property.

C#
public Style YearViewStyle { get; set; }
Remarks:

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.

C#
public static bool IsDisplayDateEndValid(RadCalendar calendar, DateTime? newDisplayDateEnd)
Parameters:calendarRadCalendar

The calendar for which to test the value.

newDisplayDateEndDateTime?

The date to test.

Returns:

bool

True if it is a valid display date end, false otherwise.

Checks whether the date is a valid DisplayDateStart value for the given calendar.

C#
public static bool IsDisplayDateStartValid(RadCalendar calendar, DateTime? newDisplayDate)
Parameters:calendarRadCalendar

The calendar for which to test the value.

newDisplayDateDateTime?

The date to test.

Returns:

bool

True if it is a valid display date start, false otherwise.

Checks whether the given date is a valid display date for the calendar.

C#
public static bool IsDisplayDateValid(RadCalendar calendar, DateTime newDisplayDate)
Parameters:calendarRadCalendar

The calendar to check the display date for.

newDisplayDateDateTime

The new display date to test.

Returns:

bool

True if it is a valid display date, false otherwise.

Checks whether the date is a valid SelectableDateEnd value for the given calendar.

C#
public static bool IsSelectableDateEndValid(RadCalendar calendar, DateTime? newSelectableDateEnd)
Parameters:calendarRadCalendar

The calendar to test for.

newSelectableDateEndDateTime?

The date to test.

Returns:

bool

True if it is a valid selectable date end, false otherwise.

Checks whether the date is a valid SelectableDateStart value for the given calendar.

C#
public static bool IsSelectableDateStartValid(RadCalendar calendar, DateTime? newSelectableDateStart)
Parameters:calendarRadCalendar

The calendar to test for.

newSelectableDateStartDateTime?

The date to test.

Returns:

bool

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 .

C#
public override void OnApplyTemplate()

Called when BlackoutDates collection changed.

C#
protected virtual void OnBlackOutDatesChanged(IEnumerable<DateTime> oldCollection, IEnumerable<DateTime> newCollection)
Parameters:oldCollectionIEnumerable<DateTime>

The old value.

newCollectionIEnumerable<DateTime>

The new value.

Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

C#
protected override AutomationPeer OnCreateAutomationPeer()
Returns:

AutomationPeer

The OnDisplayDateChanged is called when the display date of the calendar changes.

C#
protected virtual void OnDisplayDateChanged(CalendarDateChangedEventArgs e)
Parameters:eCalendarDateChangedEventArgs

The parameter contains the new and the old display dates.

OnDisplayModeChanged is called when the display mode of the calendar changes.

C#
protected virtual void OnDisplayModeChanged(CalendarModeChangedEventArgs e)
Parameters:eCalendarModeChangedEventArgs

The parameter contains the old and the new display modes.

Called before the System.Windows.UIElement.GotFocus event occurs.

C#
protected override void OnGotFocus(RoutedEventArgs e)
Parameters:eRoutedEventArgs

The data for the event.

Raises the event. This method is invoked whenever is set to true internally.

C#
protected override void OnInitialized(EventArgs e)
Parameters:eEventArgs

The RoutedEventArgs that contains the event data.

Called before the event occurs.

C#
protected override void OnKeyDown(KeyEventArgs e)
Parameters:eKeyEventArgs

The data for the event.

Called before the event occurs.

C#
protected override void OnMouseLeave(MouseEventArgs e)
Parameters:eMouseEventArgs

The data for the event.

Called before the event occurs.

C#
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters:eMouseButtonEventArgs

The data for the event.

OnSelectionChanged is called whenever the selected dates of the calendar change.

C#
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters:eSelectionChangedEventArgs

Parameter that describes how the selection has changed.

Called when SelectionMode changed.

C#
protected virtual void OnSelectionModeChanged(SelectionMode oldValue, SelectionMode newValue)
Parameters:oldValueSelectionMode

The old value.

newValueSelectionMode

The new value.

Resets the theme.

C#
public void ResetTheme()

Events

Occurs when the DisplayDate property is changed.

C#
public event EventHandler<CalendarDateChangedEventArgs> DisplayDateChanged
Remarks:

The DisplayDateChanged event is fired when the DisplayDate property of the calendar changes.

For more information on the event go to the DisplayDate help article.

Occurs when the DisplayMode property is changed.

C#
public event EventHandler<CalendarModeChangedEventArgs> DisplayModeChanged
Remarks:

The DisplayModeChanged event is fired when the DisplayDate property changes.

For more information please go to the DisplayMode article.

SelectionChanged

SelectionChangedEventHandler

Occurs when a date is selected.

C#
public event SelectionChangedEventHandler SelectionChanged
Remarks:

The DateSelected event is fired when the SelectedDate or SelectedDates 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 SelectedDates help article.

In this article
DefinitionConstructorsRadCalendar()FieldsAreWeekNamesVisiblePropertyAreWeekNumbersVisiblePropertyBlackoutDatesPropertyCalendarWeekRulePropertyCenturyViewHeaderFormatPropertyCenturyViewPanelPropertyCenturyViewStylePropertyColumnsPropertyCulturePropertyDateSelectionModePropertyDayButtonStylePropertyDayButtonStyleSelectorPropertyDayTemplatePropertyDayTemplateSelectorPropertyDecadeButtonStylePropertyDecadeButtonStyleSelectorPropertyDecadeTemplatePropertyDecadeTemplateSelectorPropertyDecadeViewHeaderFormatPropertyDecadeViewPanelPropertyDecadeViewStylePropertyDisplayDateChangedEventDisplayDateEndPropertyDisplayDatePropertyDisplayDateStartPropertyDisplayModeChangedEventDisplayModePropertyFirstDayOfWeekPropertyHeaderVisibilityPropertyIsReadOnlyPropertyIsTodayHighlightedPropertyMaxDateMinDateMonthButtonStylePropertyMonthButtonStyleSelectorPropertyMonthTemplatePropertyMonthTemplateSelectorPropertyMonthViewHeaderFormatPropertyMonthViewPanelPropertyMonthViewStylePropertyNextButtonVisibilityPropertyOrientationPropertyPreviousButtonVisibilityPropertyRowsPropertySelectableDateEndPropertySelectableDateStartPropertySelectedDatePropertySelectionChangedEventSelectionModePropertyUseShortestDayNamesPropertyViewsHeaderVisibilityPropertyYearButtonStylePropertyYearButtonStyleSelectorPropertyYearTemplatePropertyYearTemplateSelectorPropertyYearViewHeaderFormatPropertyYearViewPanelPropertyYearViewStylePropertyPropertiesAreWeekNamesVisibleAreWeekNumbersVisibleBlackoutDatesCalendarWeekRuleCenturyViewHeaderFormatCenturyViewPanelCenturyViewStyleColumnsCultureDateSelectionModeDayButtonStyleDayButtonStyleSelectorDayTemplateDayTemplateSelectorDecadeButtonStyleDecadeButtonStyleSelectorDecadeTemplateDecadeTemplateSelectorDecadeViewHeaderFormatDecadeViewPanelDecadeViewStyleDisplayDateDisplayDateEndDisplayDateStartDisplayModeFirstDayOfWeekHeaderVisibilityIsReadOnlyIsTodayHighlightedMonthButtonStyleMonthButtonStyleSelectorMonthTemplateMonthTemplateSelectorMonthViewHeaderFormatMonthViewPanelMonthViewStyleNextButtonVisibilityOrientationPreviousButtonVisibilityRowsSelectableDateEndSelectableDateStartSelectedDateSelectedDatesSelectionModeViewsHeaderVisibilityYearButtonStyleYearButtonStyleSelectorYearTemplateYearTemplateSelectorYearViewHeaderFormatYearViewPanelYearViewStyleMethodsIsDisplayDateEndValid(RadCalendar, DateTime?)IsDisplayDateStartValid(RadCalendar, DateTime?)IsDisplayDateValid(RadCalendar, DateTime)IsSelectableDateEndValid(RadCalendar, DateTime?)IsSelectableDateStartValid(RadCalendar, DateTime?)OnApplyTemplate()OnBlackOutDatesChanged(IEnumerable<DateTime>, IEnumerable<DateTime>)OnCreateAutomationPeer()OnDisplayDateChanged(CalendarDateChangedEventArgs)OnDisplayModeChanged(CalendarModeChangedEventArgs)OnGotFocus(RoutedEventArgs)OnInitialized(EventArgs)OnKeyDown(KeyEventArgs)OnMouseLeave(MouseEventArgs)OnMouseLeftButtonDown(MouseButtonEventArgs)OnSelectionChanged(SelectionChangedEventArgs)OnSelectionModeChanged(SelectionMode, SelectionMode)ResetTheme()EventsDisplayDateChangedDisplayModeChangedSelectionChanged
Not finding the help you need?
Contact Support