Skip to main content
Version: 4.1

MonthCalendar

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Represents a control that enables the user to select a date using a visual monthly calendar display.

public class MonthCalendar : Control, IReadOnly

There are 4 tooltip labels that can be localized for this control. They are already localized in the default languages provided by Wisej. An application can localize the tooltip labels by adding the string resources to the localized Resources.resx or /Properties/Resources.resx.

  • $Next year The tooltip text displayed on the popup calendar for the next-year button.
  • $Last year The tooltip text displayed on the popup calendar for the last-year button.
  • $Next month The tooltip text displayed on the popup calendar for the next-month button.
  • $Last month The tooltip text displayed on the popup calendar for the last-month button.

Constructors

Instance member MonthCalendar()

Initializes an instance of the MonthCalendar control.

Instance member MonthCalendar(onDateChanged)

Initializes an instance of the MonthCalendar control with the specified settings.

NameTypeDescription
onDateChangedAction<Object, DateRangeEventArgs>The event handler that is called when the selected date changes.

Instance member MonthCalendar(location, size, onDateChanged)

Initializes an instance of the MonthCalendar control with the specified settings.

NameTypeDescription
locationPointThe location of the TextBox on its parent control.
sizeSizeThe size of the TextBox.
onDateChangedAction<Object, DateRangeEventArgs>The event handler that is called when the selected date changes.

Properties

Instance member AnnuallyBoldedDates

DateTime[]: Returns or sets the array of DateTime objects that determines which annual days are displayed in bold.

Instance member AutoSize

Boolean: Returns or sets a value that indicates whether the control resizes based on its contents. (Default: False)

Instance member BoldedDates

DateTime[]: Returns or sets the array of DateTime objects that determines which nonrecurring dates are displayed in bold.

Instance member BorderStyle

BorderStyle: Returns or sets the type of border that is drawn around the MonthCalendar. (Default: Solid)

Instance member CalendarDimensions

Size: Returns or sets the number of columns and rows of months displayed.

Protected member DefaultSize

Size:

Instance member FirstDayOfWeek

Day: Returns or sets the first day of the week as displayed in the month calendar. (Default: Default)

Instance member MaxDate

DateTime: Returns or sets the maximum allowable date.

Throws:

Instance member MaxSelectionCount

Int32: Returns or sets the maximum number of days that can be selected in a month calendar control. (Default: 7)

Throws:

Instance member MinDate

DateTime: Returns or sets the minimum allowable date.

Throws:

Instance member MonthlyBoldedDates

DateTime[]: Returns or sets the array of DateTime objects that determine which monthly days to bold.

Instance member ReadOnly

Boolean: Returns or sets whether the control is read-only. (Default: False)

Instance member SelectionEnd

DateTime: Returns or sets the end date of the selected range of dates.

Throws:

Instance member SelectionRange

SelectionRange: Returns or sets the selected range of dates for a month calendar control.

Throws:

  • ArgumentOutOfRangeException The Start value of the assigned SelectionRange is less than the minimum date allowable for a month calendar control; or the Start value of the assigned SelectionRange is greater than the maximum allowable date for a month calendar control; or the End value of the assigned SelectionRange is less than the minimum date allowable for a month calendar control; or the End value of the assigned SelectionRange is greater than the maximum allowable date for a month calendar control.

Instance member SelectionStart

DateTime: Returns or sets the start date of the selected range of dates.

Throws:

Instance member ShowOtherMonth

Boolean: Returns or sets whether the month calendar control displays days from the previous and the next month. (Default: True)

Instance member ShowToday

Boolean: Returns or sets whether the date represented by the TodayDate property is displayed at the bottom of the control. (Default: True)

Instance member ShowToolTips

Boolean: Returns or sets whether the month calendar shows ToolTips. (Default: True)

Instance member ShowWeekNumbers

Boolean: Returns or sets whether the month calendar control displays week numbers (1-52) to the left of each row of days. (Default: True)

Instance member TodayDate

DateTime: Returns or sets the value that is used by MonthCalendar as today's date.

Throws:

  • ArgumentOutOfRangeException The value is less than the minimum allowable date; or the value is greater than the maximum allowable date.

Instance member TodayFormat

String: Returns or sets the format string used to display today's date. (Default: "d")

See Custom Date and Time Format Strings for the supported format definitions.

Instance member Tools

ComponentToolCollection: Returns the instance of ComponentToolCollection associated with this control.

Instance member ToolsPosition

HeaderPosition: Returns or sets the position of the ComponentTool items associated with this control. (Default: Top)

Methods

Instance member AddAnnuallyBoldedDate(date)

Adds a day that is displayed in bold on an annual basis in the month calendar.

ParameterTypeDescription
dateDateTimeThe date to be displayed in bold.

Instance member AddBoldedDate(date)

Adds a day to be displayed in bold in the month calendar.

ParameterTypeDescription
dateDateTimeThe date to be displayed in bold.

Instance member AddMonthlyBoldedDate(date)

Adds a day that is displayed in bold on a monthly basis in the month calendar.

ParameterTypeDescription
dateDateTimeThe date to be displayed in bold.

Protected member Dispose(disposing)

Dispose the control.

ParameterTypeDescription
disposingBooleantrue when this method is called by the application rather than a finalizer.

Instance member GetDisplayRange()

Returns the low and high limits of the displayed dates of the control.

Returns: SelectionRange. The begin and end dates of the displayed calendar.

Protected member OnDateChanged(e)

Fires the DateChanged event.

ParameterTypeDescription
eDateRangeEventArgsA DateRangeEventArgs that contains the event data.

Protected member OnDateSelected(e)

Fires the DateSelected event.

ParameterTypeDescription
eDateRangeEventArgsA DateRangeEventArgs that contains the event data.

Protected member OnDisplayRangeChanged(e)

Fires the DisplayRangeChanged event.

ParameterTypeDescription
eDateRangeEventArgsA DateRangeEventArgs that contains the event data.

Protected member OnReadOnlyChanged(e)

Fires the ReadOnlyChanged event.

ParameterTypeDescription
eEventArgsAn EventArgs that contains the event data.

Protected member OnToolClick(e)

Fires the ToolClick event.

ParameterTypeDescription
eToolClickEventArgsA ToolClickEventArgs that contains the event data.

Protected member OnWebEvent(e)

Processes the event from the client.

ParameterTypeDescription
eWisejEventArgsEvent arguments.

Protected member OnWebRender(config)

Renders the client component.

ParameterTypeDescription
configObjectDynamic configuration object.

Instance member RemoveAllAnnuallyBoldedDates()

Removes all the annually bold dates.

Instance member RemoveAllBoldedDates()

Removes all the nonrecurring bold dates.

Instance member RemoveAllMonthlyBoldedDates()

Removes all the monthly bold dates.

Instance member RemoveAnnuallyBoldedDate(date)

Removes the specified date from the list of annually bold dates.

ParameterTypeDescription
dateDateTimeThe date to remove from the date list.

Instance member RemoveBoldedDate(date)

Removes the specified date from the list of nonrecurring bold dates.

ParameterTypeDescription
dateDateTimeThe date to remove from the date list.

Instance member RemoveMonthlyBoldedDate(date)

Removes the specified date from the list of monthly bolded dates.

ParameterTypeDescription
dateDateTimeThe date to remove from the date list.

Protected member SetBoundsCore(x, y, width, height, specified)

Sets the specified bounds of the ToolBar control.

ParameterTypeDescription
xInt32The new Left property value of the control.
yInt32The new Top property value of the control.
widthInt32The new Width property value of the control.
heightInt32Not used.
specifiedBoundsSpecifiedA combination of the BoundsSpecified values.

Instance member SetCalendarDimensions(x, y)

Sets the number of columns and rows of months to display.

ParameterTypeDescription
xInt32The number of columns.
yInt32The number of rows.

Throws:

Instance member SetDate(date)

Sets a date as the currently selected date.

ParameterTypeDescription
dateDateTimeThe date to be selected.

Throws:

  • ArgumentOutOfRangeException The value is less than the minimum allowable date; or the value is greater than the maximum allowable date. This exception will only be thrown if MinDate or MaxDate have been set explicitly.

Instance member SetSelectionRange(start, end)

Sets the selected dates in a month calendar control to the specified date range.

ParameterTypeDescription
startDateTimeThe beginning date of the selection range.
endDateTimeThe end date of the selection range.

Throws:

  • ArgumentOutOfRangeException start is less than the minimum date allowable for a month calendar control; or start is greater than the maximum allowable date for a month calendar control; or end is less than the minimum date allowable for a month calendar control; or end is greater than the maximum allowable date for a month calendar control. This exception will only be thrown if MinDate or MaxDate have been set explicitly.

Events

Instance member DateChanged

DateRangeEventHandler Fired when the date shown in the MonthCalendar changes.

Instance member DateSelected

DateRangeEventHandler Fired when the user changes the selected date or range.

Instance member DisplayRangeChanged

DateRangeEventHandler Fired when the displayed range changes.

Instance member ReadOnlyChanged

EventHandler Fired when the value of the ReadOnly property has changed.

Instance member ToolClick

ToolClickEventHandler Fired when a ComponentTool is clicked.

Implements

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
IBindableComponentBindable components implement this interface.
IDropTargetControls that support drag & drop operations implement this interface.
IReadOnlyProvides access to the ReadOnly property for coontrols that support the read-only mode.
IWisejComponentAll wisej components implement this interface.
IWisejControlAll wisej controls derived from the Control class must implement this interface.
IWisejSerializableAllows an object to serialize itself.