RadCalendar
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:
[Themable]
[TelerikToolboxCategory("Input")]
public class RadCalendar : Control
Inheritance: objectRadCalendar
Constructors
Initializes a new instance of the RadCalendar class.
public RadCalendar()
Please refer to the RadCalendar 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 AreWeekNumbersVisible 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 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.
public IEnumerable<DateTime> BlackoutDates { get; set; }
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.
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 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.
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 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
StyleSelector
Gets or sets the style selector for the day buttons in the month views of the Calendar.
public StyleSelector DayButtonStyleSelector { get; set; }
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.
public DataTemplate DayTemplate { get; set; }
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.
public DataTemplateSelector DayTemplateSelector { get; set; }
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
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 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
StyleSelector
Gets or sets the style selector for the decade buttons in the century views of the Calendar.
public StyleSelector DecadeButtonStyleSelector { get; set; }
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.
public DataTemplate DecadeTemplate { get; set; }
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.
public DataTemplateSelector DecadeTemplateSelector { get; set; }
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.
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 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.
public DateTime? DisplayDateEnd { get; set; }
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.
public DateTime? DisplayDateStart { get; set; }
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.
public DisplayMode DisplayMode { get; set; }
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.
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>
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 Collapsed and ViewsHeaderVisibility to Visible.
Gets or sets whether the Calendar's selection can be changed. This is a dependency property.
public bool IsReadOnly { get; set; }
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.
public bool IsTodayHighlighted { get; set; }
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
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 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
StyleSelector
Gets or sets the style selector for the month buttons in the year views of the Calendar.
public StyleSelector MonthButtonStyleSelector { get; set; }
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.
public DataTemplate MonthTemplate { get; set; }
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.
public DataTemplateSelector MonthTemplateSelector { get; set; }
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.
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 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
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 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.
public DateTime? SelectableDateEnd { get; set; }
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.
public DateTime? SelectableDateStart { get; set; }
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.
public DateTime? SelectedDate { get; set; }
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.
public IList<DateTime> SelectedDates { get; }
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.
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 Rows and Columns 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 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
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 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
StyleSelector
Gets or sets the style selector for the year buttons in the decade views of the Calendar.
public StyleSelector YearButtonStyleSelector { get; set; }
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.
public DataTemplate YearTemplate { get; set; }
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.
public DataTemplateSelector YearTemplateSelector { get; set; }
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.
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.
OnCreateAutomationPeer()
AutomationPeer
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 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.
public event EventHandler<CalendarModeChangedEventArgs> DisplayModeChanged
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.
public event SelectionChangedEventHandler SelectionChanged
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.