MonthView
Represents a calendar view that displays one month at a time.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.UI.dll
Syntax:
public class MonthView : CalendarView, INotifyPropertyChanged
Inheritance: objectCalendarViewMonthView
Derived Classes:
Implements:
Inherited Members
Constructors
Initializes a view for the month containing the specified date and attaches it to a parent view.
public MonthView(RadCalendar parent, DateTime inMonthDate, CalendarView parentView)
The calendar associated with the view.
inMonthDateDateTimeA date used to determine the month displayed by the view.
parentViewCalendarViewThe parent in the calendar view hierarchy, or null for a root view.
Initializes a view for the month containing the specified date.
public MonthView(RadCalendar parent, DateTime inMonthDate)
The calendar associated with the view.
inMonthDateDateTimeA date used to determine the month displayed by the view.
Initializes a single-month view associated with a calendar.
public MonthView(RadCalendar parent)
The calendar associated with the view.
Properties
Gets a value indicating whether the CalendarView has child views.
public override bool IsMultipleView { get; }
Overrides:
Returns the number of months displayed by a particular MonthView (in this case 1).
protected virtual int MonthsInView { get; }
Methods
Moves a view start date by a number of month-view periods using the calendar's current calendar.
protected override DateTime AddViewPeriods(DateTime startDate, int periods)
The date from which to calculate the new view start.
periodsintThe number of month-view periods to move; negative values move backward.
Returns:The date reached after applying the requested number of periods.
Overrides:
Creates an uninitialized single-month view associated with the same calendar.
Creates a CalendarView object based on the logic implemented by the CalendarView instance that implements the method.
protected override CalendarView CreateView(DateTime date)
DateTime object that is used to create the CalendarView.
Returns:The created CalendarView object.
Overrides:
Dates before the supported minimum are replaced with that minimum; dates after the maximum use the date one month before the maximum.
Returns the DateTime object that is used by the CalendarView to initialize.
protected override DateTime EffectiveVisibleDate()
DateTime object that is used by the CalendarView to initialize.
Overrides:
Uses the specified in-month date when present, otherwise the base effective date, and returns the first day of that month.
Validates the month grid dimensions and header-selector settings against the render requirements.
protected override void EnsureRenderSettings()
Thrown when nonzero row and column counts do not divide 42 evenly, or when horizontal layout shows column headers with column selectors enabled and fewer than seven columns, or vertical layout shows row headers with row selectors enabled and fewer than seven rows.
DivideByZeroExceptionThrown when either the row or column count is zero.
Overrides:
Gets the RadCalendarDay object associated with a particular DateTime object if any.
protected virtual RadCalendarDay GetSpecialDay(DateTime processedDate)
DateTime object to be tested.
Returns:The retrieved RadCalendarDay object.
Retrieves the ToolTip text associated with a particular RadCalendarDay object.
protected virtual string GetToolTip(RadCalendarDay calendarDay)
RadCalendarDay object
Returns:The retrieved ToolTip text associated with a particular RadCalendarDay object
handles the End key.
protected override void HandleEndKey(Keys keys)
The key data to be processed.
Overrides:
Moves focus to the last date in the current view.
handles the Home key.
protected override void HandleHomeKey(Keys keys)
The key data to be processed.
Overrides:
Moves focus to the first date in the current view.
handles the left arrow key.
protected override void HandleLeftKey(Keys keys)
The key data to be processed.
Overrides:
With Control, moves back one month. Otherwise, moves focus back one week in a vertical layout or one day in other layouts.
handles the page down key.
protected override void HandlePageDownKey(Keys keys)
The key data to be processed.
Overrides:
Moves the focused date forward by one month.
handles the page up key.
protected override void HandlePageUpKey(Keys keys)
The key data to be processed.
Overrides:
Moves the focused date back by one month.
handles the right arrow key.
protected override void HandleRightKey(Keys keys)
The key data to be processed.
Overrides:
With Control, moves forward one month. Otherwise, moves focus forward one week in a vertical layout or one day in other layouts.
Initializes properly the ViewStartDate, ViewEndDate, ViewRenderStartDate, ViewRenderEndDate properties
protected override void SetDateRange()
Overrides:
The render range also accounts for the first weekday and the configured row and column count of the month grid.
Toogles the date selection (Enter key).
protected override void ToggleSelection(Keys keys)
The key data to be processed.
Overrides:
Does nothing when the calendar is read-only. Otherwise, raises the selection-changing event, which can cancel the toggle; a canceled toggle does not raise the selection-changed event. If allowed, toggles the focused date in SelectedDates. In single-selection mode, an existing selection is cleared before the toggle.