New to Telerik UI for WinForms? Start a free 30-day trial

Represents a calendar view that displays one month at a time.

Definition

Namespace:Telerik.WinControls.UI

Assembly:Telerik.WinControls.UI.dll

Syntax:

C#
public class MonthView : CalendarView, INotifyPropertyChanged

Inheritance: objectCalendarViewMonthView

Derived Classes: MultiMonthView

Implements: INotifyPropertyChanged

Inherited Members CalendarView.Dispose()CalendarView.IsDateInView(DateTime)CalendarView.Select(DateTime)CalendarView.SelectRange(DateTime[])CalendarView.SelectRange(DateTime, DateTime)CalendarView.GetPreviousViewDate()CalendarView.GetNextViewDate()CalendarView.EnsureChildViews()CalendarView.HandleKeyDown(Keys)CalendarView.OnNotifyPropertyChanged(string)CalendarView.OnNotifyPropertyChanged(PropertyChangedEventArgs)CalendarView.CalendarCalendarView.ParentCalendarView.ChildrenCalendarView.NameCalendarView.CellToolTipFormatCalendarView.OrientationCalendarView.TitleAlignCalendarView.VisibleCalendarView.RootViewCalendarView.IsRootViewCalendarView.LevelCalendarView.ReadOnlyCalendarView.ViewSelectorTextCalendarView.RowHeaderTextCalendarView.ColumnHeaderTextCalendarView.ColumnHeaderImageCalendarView.RowHeaderImageCalendarView.CellMarginCalendarView.CellPaddingCalendarView.ViewSelectorImageCalendarView.ShowOtherMonthsDaysCalendarView.AllowFishEyeCalendarView.ZoomFactorCalendarView.MonthLayoutCalendarView.HeaderWidthCalendarView.HeaderHeightCalendarView.ShowSelectorCalendarView.MultiViewRowsCalendarView.MultiViewColumnsCalendarView.ShowHeaderCalendarView.TitleFormatCalendarView.ShowColumnHeadersCalendarView.ShowRowHeadersCalendarView.AllowRowHeaderSelectorsCalendarView.AllowColumnHeaderSelectorsCalendarView.AllowViewSelectorCalendarView.ViewRenderStartDateCalendarView.ViewRenderEndDateCalendarView.ViewStartDateCalendarView.ViewEndDateCalendarView.RowsCalendarView.ColumnsCalendarView.PreviousViewCalendarView.NextViewCalendarView.CurrentCalendarCalendarView.CellVerticalSpacingCalendarView.CellHorizontalSpacingCalendarView.PropertyChanged...

Constructors

Initializes a view for the month containing the specified date and attaches it to a parent view.

C#
public MonthView(RadCalendar parent, DateTime inMonthDate, CalendarView parentView)
Parameters:parentRadCalendar

The calendar associated with the view.

inMonthDateDateTime

A date used to determine the month displayed by the view.

parentViewCalendarView

The parent in the calendar view hierarchy, or null for a root view.

Initializes a view for the month containing the specified date.

C#
public MonthView(RadCalendar parent, DateTime inMonthDate)
Parameters:parentRadCalendar

The calendar associated with the view.

inMonthDateDateTime

A date used to determine the month displayed by the view.

Initializes a single-month view associated with a calendar.

C#
public MonthView(RadCalendar parent)
Parameters:parentRadCalendar

The calendar associated with the view.

Properties

Gets a value indicating whether the CalendarView has child views.

C#
public override bool IsMultipleView { get; }

Overrides: CalendarView.IsMultipleView

Returns the number of months displayed by a particular MonthView (in this case 1).

C#
protected virtual int MonthsInView { get; }

Methods

Moves a view start date by a number of month-view periods using the calendar's current calendar.

C#
protected override DateTime AddViewPeriods(DateTime startDate, int periods)
Parameters:startDateDateTime

The date from which to calculate the new view start.

periodsint

The number of month-view periods to move; negative values move backward.

Returns:

DateTime

The date reached after applying the requested number of periods.

Overrides: CalendarView.AddViewPeriods(DateTime, int)

Creates an uninitialized single-month view associated with the same calendar.

C#
protected override CalendarView CreateView()
Returns:

CalendarView

Overrides: CalendarView.CreateView()

Creates a CalendarView object based on the logic implemented by the CalendarView instance that implements the method.

C#
protected override CalendarView CreateView(DateTime date)
Parameters:dateDateTime

DateTime object that is used to create the CalendarView.

Returns:

CalendarView

The created CalendarView object.

Overrides: CalendarView.CreateView(DateTime)

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.

C#
protected override DateTime EffectiveVisibleDate()
Returns:

DateTime

DateTime object that is used by the CalendarView to initialize.

Overrides: CalendarView.EffectiveVisibleDate()

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.

C#
protected override void EnsureRenderSettings()
Exceptions: ArgumentException

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.

DivideByZeroException

Thrown when either the row or column count is zero.

Overrides: CalendarView.EnsureRenderSettings()

Gets the string representation for a particular day in the week.

C#
protected virtual string GetDayHeaderString(int weekDay)
Parameters:weekDayint

Specifies the day of the week.

Returns:

string

the string representation for the specified day.

Gets the RadCalendarDay object associated with a particular DateTime object if any.

C#
protected virtual RadCalendarDay GetSpecialDay(DateTime processedDate)
Parameters:processedDateDateTime

DateTime object to be tested.

Returns:

RadCalendarDay

The retrieved RadCalendarDay object.

Formats the tooltip text for a date using the calendar's tooltip format and culture when configured.

C#
protected virtual string GetToolTip(DateTime processedDate)
Parameters:processedDateDateTime

The date whose tooltip text is requested.

Returns:

string

The formatted date text.

Retrieves the ToolTip text associated with a particular RadCalendarDay object.

C#
protected virtual string GetToolTip(RadCalendarDay calendarDay)
Parameters:calendarDayRadCalendarDay

RadCalendarDay object

Returns:

string

The retrieved ToolTip text associated with a particular RadCalendarDay object

handles the down arrow key.

C#
protected override void HandleDownKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandleDownKey(Keys)

Moves focus one day in a vertical layout or one week otherwise; no movement occurs at MaxValue.

handles the End key.

C#
protected override void HandleEndKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandleEndKey(Keys)

Moves focus to the last date in the current view.

handles the Home key.

C#
protected override void HandleHomeKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandleHomeKey(Keys)

Moves focus to the first date in the current view.

handles the left arrow key.

C#
protected override void HandleLeftKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandleLeftKey(Keys)

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.

C#
protected override void HandlePageDownKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandlePageDownKey(Keys)

Moves the focused date forward by one month.

handles the page up key.

C#
protected override void HandlePageUpKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandlePageUpKey(Keys)

Moves the focused date back by one month.

handles the right arrow key.

C#
protected override void HandleRightKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandleRightKey(Keys)

With Control, moves forward one month. Otherwise, moves focus forward one week in a vertical layout or one day in other layouts.

handles the up arrow key.

C#
protected override void HandleUpKey(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.HandleUpKey(Keys)

Moves focus one day in a vertical layout or one week otherwise; no movement occurs at MinValue.

Initializes properly the ViewStartDate, ViewEndDate, ViewRenderStartDate, ViewRenderEndDate properties

C#
protected override void SetDateRange()

Overrides: CalendarView.SetDateRange()

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

C#
protected override void ToggleSelection(Keys keys)
Parameters:keysKeys

The key data to be processed.

Overrides: CalendarView.ToggleSelection(Keys)

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.