ClassRadCalendar
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:
[SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Currently not feasible")]
[Themable]
[TelerikToolboxCategory("Input")]
public class RadCalendar : Control
Inheritance: objectRadCalendar
Constructors
RadCalendar()
Initializes a new instance of the RadCalendar class.
Declaration
public RadCalendar()
Remarks
Please refer to the RadCalendar information examples on how to use the control.
Fields
AreWeekNamesVisibleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty AreWeekNamesVisibleProperty
Field Value
DependencyProperty
AreWeekNumbersVisibleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty AreWeekNumbersVisibleProperty
Field Value
DependencyProperty
BlackoutDatesProperty
Identifies the property.
Declaration
public static readonly DependencyProperty BlackoutDatesProperty
Field Value
DependencyProperty
CalendarWeekRuleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty CalendarWeekRuleProperty
Field Value
DependencyProperty
CenturyViewHeaderFormatProperty
Identifies the property.
Declaration
public static readonly DependencyProperty CenturyViewHeaderFormatProperty
Field Value
DependencyProperty
CenturyViewPanelProperty
Identifies the property.
Declaration
public static readonly DependencyProperty CenturyViewPanelProperty
Field Value
DependencyProperty
CenturyViewStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty CenturyViewStyleProperty
Field Value
DependencyProperty
ColumnsProperty
Identifies the property.
Declaration
public static readonly DependencyProperty ColumnsProperty
Field Value
DependencyProperty
CultureProperty
Identifies the property.
Declaration
public static readonly DependencyProperty CultureProperty
Field Value
DependencyProperty
DateSelectionModeProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DateSelectionModeProperty
Field Value
DependencyProperty
DayButtonStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DayButtonStyleProperty
Field Value
DependencyProperty
DayButtonStyleSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DayButtonStyleSelectorProperty
Field Value
DependencyProperty
DayTemplateProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DayTemplateProperty
Field Value
DependencyProperty
DayTemplateSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DayTemplateSelectorProperty
Field Value
DependencyProperty
DecadeButtonStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DecadeButtonStyleProperty
Field Value
DependencyProperty
DecadeButtonStyleSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DecadeButtonStyleSelectorProperty
Field Value
DependencyProperty
DecadeTemplateProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DecadeTemplateProperty
Field Value
DependencyProperty
DecadeTemplateSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DecadeTemplateSelectorProperty
Field Value
DependencyProperty
DecadeViewHeaderFormatProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DecadeViewHeaderFormatProperty
Field Value
DependencyProperty
DecadeViewPanelProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DecadeViewPanelProperty
Field Value
DependencyProperty
DecadeViewStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DecadeViewStyleProperty
Field Value
DependencyProperty
DisplayDateChangedEvent
Identifies the Event.
Declaration
public static readonly RoutedEvent DisplayDateChangedEvent
Field Value
RoutedEvent
DisplayDateEndProperty
Identifies the Property.
Declaration
public static readonly DependencyProperty DisplayDateEndProperty
Field Value
DependencyProperty
DisplayDateProperty
Identifies the property.
Declaration
public static readonly DependencyProperty DisplayDateProperty
Field Value
DependencyProperty
DisplayDateStartProperty
Identifies the .
Declaration
public static readonly DependencyProperty DisplayDateStartProperty
Field Value
DependencyProperty
DisplayModeChangedEvent
Identifies the Event.
Declaration
public static readonly RoutedEvent DisplayModeChangedEvent
Field Value
RoutedEvent
DisplayModeProperty
Identifies the Property.
Declaration
public static readonly DependencyProperty DisplayModeProperty
Field Value
DependencyProperty
FirstDayOfWeekProperty
Identifies the property.
Declaration
public static readonly DependencyProperty FirstDayOfWeekProperty
Field Value
DependencyProperty
HeaderVisibilityProperty
Identifies the property.
Declaration
public static readonly DependencyProperty HeaderVisibilityProperty
Field Value
DependencyProperty
IsReadOnlyProperty
Identifies the property.
Declaration
public static readonly DependencyProperty IsReadOnlyProperty
Field Value
DependencyProperty
IsTodayHighlightedProperty
Identifies the dependency property.
Declaration
public static readonly DependencyProperty IsTodayHighlightedProperty
Field Value
DependencyProperty
MaxDate
Gets the latest date that the calendar can display.
MinDate
Gets the earliest date that the calendar can display.
MonthButtonStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty MonthButtonStyleProperty
Field Value
DependencyProperty
MonthButtonStyleSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty MonthButtonStyleSelectorProperty
Field Value
DependencyProperty
MonthTemplateProperty
Identifies the property.
Declaration
public static readonly DependencyProperty MonthTemplateProperty
Field Value
DependencyProperty
MonthTemplateSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty MonthTemplateSelectorProperty
Field Value
DependencyProperty
MonthViewHeaderFormatProperty
Identifies the property.
Declaration
public static readonly DependencyProperty MonthViewHeaderFormatProperty
Field Value
DependencyProperty
MonthViewPanelProperty
Identifies the property.
Declaration
public static readonly DependencyProperty MonthViewPanelProperty
Field Value
DependencyProperty
MonthViewStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty MonthViewStyleProperty
Field Value
DependencyProperty
NextButtonVisibilityProperty
Identifies the property.
Declaration
public static readonly DependencyProperty NextButtonVisibilityProperty
Field Value
DependencyProperty
OrientationProperty
Identifies the property.
Declaration
public static readonly DependencyProperty OrientationProperty
Field Value
DependencyProperty
PreviousButtonVisibilityProperty
Identifies the property.
Declaration
public static readonly DependencyProperty PreviousButtonVisibilityProperty
Field Value
DependencyProperty
RowsProperty
Identifies the property.
Declaration
public static readonly DependencyProperty RowsProperty
Field Value
DependencyProperty
SelectableDateEndProperty
Identifies the property.
Declaration
public static readonly DependencyProperty SelectableDateEndProperty
Field Value
DependencyProperty
SelectableDateStartProperty
Identifies the dependency property.
Declaration
public static readonly DependencyProperty SelectableDateStartProperty
Field Value
DependencyProperty
SelectedDateProperty
Identifies the dependency property.
Declaration
public static readonly DependencyProperty SelectedDateProperty
Field Value
DependencyProperty
SelectionChangedEvent
Identifies the Event.
Declaration
public static readonly RoutedEvent SelectionChangedEvent
Field Value
RoutedEvent
SelectionModeProperty
Identifies the dependency property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
DependencyProperty
UseShortestDayNamesProperty
Identifies the property.
The value that indicates whether the week names buttons are using shortest day names.
It's used in office 2013 theme.
Declaration
public static readonly DependencyProperty UseShortestDayNamesProperty
Field Value
DependencyProperty
ViewsHeaderVisibilityProperty
Identifies the property.
Declaration
public static readonly DependencyProperty ViewsHeaderVisibilityProperty
Field Value
DependencyProperty
YearButtonStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty YearButtonStyleProperty
Field Value
DependencyProperty
YearButtonStyleSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty YearButtonStyleSelectorProperty
Field Value
DependencyProperty
YearTemplateProperty
Identifies the property.
Declaration
public static readonly DependencyProperty YearTemplateProperty
Field Value
DependencyProperty
YearTemplateSelectorProperty
Identifies the property.
Declaration
public static readonly DependencyProperty YearTemplateSelectorProperty
Field Value
DependencyProperty
YearViewHeaderFormatProperty
Identifies the property.
Declaration
public static readonly DependencyProperty YearViewHeaderFormatProperty
Field Value
DependencyProperty
YearViewPanelProperty
Identifies the property.
Declaration
public static readonly DependencyProperty YearViewPanelProperty
Field Value
DependencyProperty
YearViewStyleProperty
Identifies the property.
Declaration
public static readonly DependencyProperty YearViewStyleProperty
Field Value
DependencyProperty
Properties
AreWeekNamesVisible
Gets or sets whether WeekNames will be displayed.
Declaration
public bool AreWeekNamesVisible { get; set; }
Property Value
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.
AreWeekNumbersVisible
Gets or sets whether WeekNumbers will be displayed.
Declaration
public bool AreWeekNumbersVisible { get; set; }
Property Value
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.
BlackoutDates
Gets or sets a list of dates that cannot be selected. This is a dependency property.
Declaration
public IEnumerable<DateTime> BlackoutDates { get; set; }
Property Value
Remarks
The BlackoutDates specifies a list of dates that cannot be selected by the user.
CalendarWeekRule
Gets or sets how should the first week in the year be counted. This is a dependency property.
Declaration
public CalendarWeekRule? CalendarWeekRule { get; set; }
Property Value
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.
CenturyViewHeaderFormat
Gets or sets the format for the header of the century views of the calendar. This is a dependency property.
Declaration
public string CenturyViewHeaderFormat { get; set; }
Property Value
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
Gets or sets the items panel template for the century views of the calendar. This is a dependency property.
Declaration
public ItemsPanelTemplate CenturyViewPanel { get; set; }
Property Value
ItemsPanelTemplate
CenturyViewStyle
Gets or sets the style of the century calendar view. This is a dependency property.
Declaration
public Style CenturyViewStyle { get; set; }
Property Value
Style
Columns
Gets or sets the number of columns of calendar views in the calendar. This is a dependency property.
Declaration
public int Columns { get; set; }
Property Value
Remarks
The minimum value of the Columns property is one and the maximum is four.
Culture
Gets or sets the culture that the Calendar uses. This is a dependency property.
Declaration
public CultureInfo Culture { get; set; }
Property Value
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.
DateSelectionMode
Gets or sets DateSelectionMode property. This is a dependency property.
Declaration
public DateSelectionMode DateSelectionMode { get; set; }
Property Value
DayButtonStyle
Gets or sets the style for the day buttons in the month views of the calendar. This is a dependency property.
Declaration
public Style DayButtonStyle { get; set; }
Property Value
Style
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.
DayButtonStyleSelector
Gets or sets the style selector for the day buttons in the month views of the Calendar.
Declaration
public StyleSelector DayButtonStyleSelector { get; set; }
Property Value
StyleSelector
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
Gets or sets the content templates for the day buttons in the month views of the calendar. This is a dependency property.
Declaration
public DataTemplate DayTemplate { get; set; }
Property Value
DataTemplate
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
Gets or sets the DataTemplate selectors for the day buttons in the month views of the calendar. This is a dependency property.
Declaration
public DataTemplateSelector DayTemplateSelector { get; set; }
Property Value
DataTemplateSelector
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.
DecadeButtonStyle
Gets or sets the style for the year decade in the century views of the calendar. This is a dependency property.
Declaration
public Style DecadeButtonStyle { get; set; }
Property Value
Style
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.
DecadeButtonStyleSelector
Gets or sets the style selector for the decade buttons in the century views of the Calendar.
Declaration
public StyleSelector DecadeButtonStyleSelector { get; set; }
Property Value
StyleSelector
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
Gets or sets the content templates for the decade buttons in the century views of the calendar. This is a dependency property.
Declaration
public DataTemplate DecadeTemplate { get; set; }
Property Value
DataTemplate
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
Gets or sets the DataTemplate selectors for the decade buttons in the century views of the calendar. This is a dependency property.
Declaration
public DataTemplateSelector DecadeTemplateSelector { get; set; }
Property Value
DataTemplateSelector
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.
DecadeViewHeaderFormat
Gets or sets the format for the header of the decade views of the calendar. This is a dependency property.
Declaration
public string DecadeViewHeaderFormat { get; set; }
Property Value
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
Gets or sets the items panel template for the decade views of the calendar. This is a dependency property.
Declaration
public ItemsPanelTemplate DecadeViewPanel { get; set; }
Property Value
ItemsPanelTemplate
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.
DecadeViewStyle
Gets or sets the style of the decade calendar view. This is a dependency property.
Declaration
public Style DecadeViewStyle { get; set; }
Property Value
Style
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.
DisplayDate
Gets or sets the current date to display. This is a dependency property.
Declaration
public DateTime DisplayDate { get; set; }
Property Value
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.
DisplayDateEnd
Gets or sets the last date that would be able to be displayed. This is a dependency property.
Declaration
public DateTime? DisplayDateEnd { get; set; }
Property Value
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.
DisplayDateStart
Gets or sets the first date that would be able to be displayed. This is a dependency property.
Declaration
public DateTime? DisplayDateStart { get; set; }
Property Value
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.
DisplayMode
Gets or sets the display mode of the Calendar. This is a dependency property.
Declaration
public DisplayMode DisplayMode { get; set; }
Property Value
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.
FirstDayOfWeek
Gets or sets the day that is considered the beginning of the week.
Declaration
public DayOfWeek? FirstDayOfWeek { get; set; }
Property Value
Remarks
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.
calendar.FirstDayOfWeek = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
HeaderVisibility
Gets or sets the visibility of the Calendar's header. This is a dependency property.
Declaration
public Visibility HeaderVisibility { get; set; }
Property Value
Visibility
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.
IsReadOnly
Gets or sets whether the Calendar's selection can be changed. This is a dependency property.
Declaration
public bool IsReadOnly { get; set; }
Property Value
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.
IsTodayHighlighted
Gets or sets whether the today date would be highlighted. This is a dependency property.
Declaration
public bool IsTodayHighlighted { get; set; }
Property Value
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).
MonthButtonStyle
Gets or sets the style for the month buttons in the year views of the calendar. This is a dependency property.
Declaration
public Style MonthButtonStyle { get; set; }
Property Value
Style
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.
MonthButtonStyleSelector
Gets or sets the style selector for the month buttons in the year views of the Calendar.
Declaration
public StyleSelector MonthButtonStyleSelector { get; set; }
Property Value
StyleSelector
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
Gets or sets the content templates for the month buttons in the year views of the calendar. This is a dependency property.
Declaration
public DataTemplate MonthTemplate { get; set; }
Property Value
DataTemplate
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
Gets or sets the DataTemplate selectors for the month buttons in the year views of the calendar. This is a dependency property.
Declaration
public DataTemplateSelector MonthTemplateSelector { get; set; }
Property Value
DataTemplateSelector
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.
MonthViewHeaderFormat
Gets or sets the format for the header of the month views of the calendar. This is a dependency property.
Declaration
public string MonthViewHeaderFormat { get; set; }
Property Value
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
Gets or sets the items panel template for the month views of the calendar. This is a dependency property.
Declaration
public ItemsPanelTemplate MonthViewPanel { get; set; }
Property Value
ItemsPanelTemplate
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.
MonthViewStyle
Gets or sets the style of the month calendar view. This is a dependency property.
Declaration
public Style MonthViewStyle { get; set; }
Property Value
Style
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.
NextButtonVisibility
Gets or sets the visibility of the Calendar's MoveRight button. This is a dependency property.
Declaration
public Visibility NextButtonVisibility { get; set; }
Property Value
Visibility
Remarks
The MoveRight button of the calendar is in the area on the top in which the Header Button and the PreviousButton reside.
Orientation
Gets or sets whether the orientation of the Calendar. This is a dependency property.
Declaration
public Orientation Orientation { get; set; }
Property Value
Orientation
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.
PreviousButtonVisibility
Gets or sets the visibility of the Calendar's MoveLeft button. This is a dependency property.
Declaration
public Visibility PreviousButtonVisibility { get; set; }
Property Value
Visibility
Remarks
The MoveLeft button of the calendar is in the area on the top in which the Header Button and the NextButton reside.
Rows
Gets or sets the number of rows of calendar views in the calendar. This is a dependency property.
Declaration
public int Rows { get; set; }
Property Value
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.
SelectableDateEnd
Gets or sets the last date that can be selected. This is a dependency property.
Declaration
public DateTime? SelectableDateEnd { get; set; }
Property Value
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.
SelectableDateStart
Gets or sets the first date that can be selected. This is a dependency property.
Declaration
public DateTime? SelectableDateStart { get; set; }
Property Value
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.
SelectedDate
Gets or sets the currently selected date. This is a dependency property.
Declaration
public DateTime? SelectedDate { get; set; }
Property Value
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.
SelectedDates
Gets an list of the currently selected dates.
Declaration
public IList<DateTime> SelectedDates { get; }
Property Value
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
Gets or sets the types of selection that would be allowed in the Calendar. This is a dependency property.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
SelectionMode
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.
ViewsHeaderVisibility
Gets or sets the visibility of the header of the calendar views (month, year, decade, century). This is a dependency property.
Declaration
public Visibility ViewsHeaderVisibility { get; set; }
Property Value
Visibility
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.
YearButtonStyle
Gets or sets the style for the year buttons in the decade views of the calendar. This is a dependency property.
Declaration
public Style YearButtonStyle { get; set; }
Property Value
Style
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.
YearButtonStyleSelector
Gets or sets the style selector for the year buttons in the decade views of the Calendar.
Declaration
public StyleSelector YearButtonStyleSelector { get; set; }
Property Value
StyleSelector
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
Gets or sets the content templates for the year buttons in the decade views of the calendar. This is a dependency property.
Declaration
public DataTemplate YearTemplate { get; set; }
Property Value
DataTemplate
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
Gets or sets the DataTemplate selectors for the year buttons in the decade views of the calendar. This is a dependency property.
Declaration
public DataTemplateSelector YearTemplateSelector { get; set; }
Property Value
DataTemplateSelector
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.
YearViewHeaderFormat
Gets or sets the format for the header of the year views of the calendar. This is a dependency property.
Declaration
public string YearViewHeaderFormat { get; set; }
Property Value
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
Gets or sets the items panel template for the year views of the calendar. This is a dependency property.
Declaration
public ItemsPanelTemplate YearViewPanel { get; set; }
Property Value
ItemsPanelTemplate
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.
YearViewStyle
Gets or sets the style of the calendar year view. This is a dependency property.
Declaration
public Style YearViewStyle { get; set; }
Property Value
Style
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
IsDisplayDateEndValid(RadCalendar, DateTime?)
Checks whether the date is a valid DisplayDateEnd value for the given calendar.
Declaration
public static bool IsDisplayDateEndValid(RadCalendar calendar, DateTime? newDisplayDateEnd)
Parameters
calendar
The calendar for which to test the value.
newDisplayDateEnd
The date to test.
Returns
True if it is a valid display date end, false otherwise.
IsDisplayDateStartValid(RadCalendar, DateTime?)
Checks whether the date is a valid DisplayDateStart value for the given calendar.
Declaration
public static bool IsDisplayDateStartValid(RadCalendar calendar, DateTime? newDisplayDate)
Parameters
calendar
The calendar for which to test the value.
newDisplayDate
The date to test.
Returns
True if it is a valid display date start, false otherwise.
IsDisplayDateValid(RadCalendar, DateTime)
Checks whether the given date is a valid display date for the calendar.
Declaration
public static bool IsDisplayDateValid(RadCalendar calendar, DateTime newDisplayDate)
Parameters
calendar
The calendar to check the display date for.
newDisplayDate
The new display date to test.
Returns
True if it is a valid display date, false otherwise.
IsSelectableDateEndValid(RadCalendar, DateTime?)
Checks whether the date is a valid SelectableDateEnd value for the given calendar.
Declaration
public static bool IsSelectableDateEndValid(RadCalendar calendar, DateTime? newSelectableDateEnd)
Parameters
calendar
The calendar to test for.
newSelectableDateEnd
The date to test.
Returns
True if it is a valid selectable date end, false otherwise.
IsSelectableDateStartValid(RadCalendar, DateTime?)
Checks whether the date is a valid SelectableDateStart value for the given calendar.
Declaration
public static bool IsSelectableDateStartValid(RadCalendar calendar, DateTime? newSelectableDateStart)
Parameters
calendar
The calendar to test for.
newSelectableDateStart
The date to test.
Returns
True if it is a valid selectable date start, false otherwise.
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes call .
Declaration
public override void OnApplyTemplate()
OnBlackOutDatesChanged(IEnumerable<DateTime>, IEnumerable<DateTime>)
Called when BlackoutDates collection changed.
Declaration
protected virtual void OnBlackOutDatesChanged(IEnumerable<DateTime> oldCollection, IEnumerable<DateTime> newCollection)
Parameters
oldCollection
The old value.
newCollection
The new value.
OnCreateAutomationPeer()
Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
AutomationPeer
OnDisplayDateChanged(CalendarDateChangedEventArgs)
The OnDisplayDateChanged is called when the display date of the calendar changes.
Declaration
protected virtual void OnDisplayDateChanged(CalendarDateChangedEventArgs e)
Parameters
e
The parameter contains the new and the old display dates.
OnDisplayModeChanged(CalendarModeChangedEventArgs)
OnDisplayModeChanged is called when the display mode of the calendar changes.
Declaration
protected virtual void OnDisplayModeChanged(CalendarModeChangedEventArgs e)
Parameters
e
The parameter contains the old and the new display modes.
OnGotFocus(RoutedEventArgs)
Called before the System.Windows.UIElement.GotFocus event occurs.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
e
RoutedEventArgs
The data for the event.
OnInitialized(EventArgs)
Raises the event. This method is invoked whenever is set to true internally.
Declaration
protected override void OnInitialized(EventArgs e)
Parameters
e
The RoutedEventArgs that contains the event data.
OnKeyDown(KeyEventArgs)
Called before the event occurs.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
e
KeyEventArgs
The data for the event.
OnMouseLeave(MouseEventArgs)
Called before the event occurs.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
e
MouseEventArgs
The data for the event.
OnMouseLeftButtonDown(MouseButtonEventArgs)
Called before the event occurs.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
e
MouseButtonEventArgs
The data for the event.
OnSelectionChanged(SelectionChangedEventArgs)
OnSelectionChanged is called whenever the selected dates of the calendar change.
Declaration
protected virtual void OnSelectionChanged(SelectionChangedEventArgs e)
Parameters
e
SelectionChangedEventArgs
Parameter that describes how the selection has changed.
OnSelectionModeChanged(SelectionMode, SelectionMode)
Called when SelectionMode changed.
Declaration
protected virtual void OnSelectionModeChanged(SelectionMode oldValue, SelectionMode newValue)
Parameters
oldValue
SelectionMode
The old value.
newValue
SelectionMode
The new value.
Events
DisplayDateChanged
Occurs when the DisplayDate property is changed.
Declaration
public event EventHandler<CalendarDateChangedEventArgs> DisplayDateChanged
Event Value
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.
DisplayModeChanged
Occurs when the DisplayMode property is changed.
Declaration
public event EventHandler<CalendarModeChangedEventArgs> DisplayModeChanged
Event Value
Remarks
The DisplayModeChanged event is fired when the DisplayDate property changes.
For more information please go to the DisplayMode article.
SelectionChanged
Occurs when a date is selected.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Value
SelectionChangedEventHandler
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.