JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the Calendar Class

You use the Calendar class to display a single-month calendar that allows the user to select dates and move to the next or previous month. Here is the inheritance diagram for this class:

Object
   Control
      WebControl
         Calendar

You can find the notable public properties of Calendar objects in Table 18.12, and their notable public events in Table 18.13. (This class has no non-inherited methods.) Note that as with other Web server controls, I am not listing the notable properties, methods, and events this class inherits from the Control and WebControl classes-you can find them in Chapter 15, Tables 15.1 to 15.5.

Table 18.12: Noteworthy public properties of Calendar objects.

Property

Means

CellPadding

Gets/sets the space used for cell padding in the calendar.

CellSpacing

Gets/sets the space between cells in the calendar.

DayHeaderStyle

Gets the style for the day of the week.

DayNameFormat

Gets/sets the day of the week's name format.

DayStyle

Gets the style for days.

FirstDayOfWeek

Gets/sets the day of the week displayed in the first column.

NextMonthText

Gets/sets the text labeling the next month navigation control.

NextPrevFormat

Gets/sets the format of both the next and previous month navigation controls.

NextPrevStyle

Gets/sets the style for the next and previous month navigation controls.

OtherMonthDayStyle

Gets the style for the days not in the displayed month.

PrevMonthText

Gets/sets the text for the previous month navigation control.

SelectedDate

Gets/sets the selected date.

SelectedDates

Gets a collection of DateTime objects for the selected dates.

SelectedDayStyle

Gets the style for selected dates.

SelectionMode

Gets/sets the date selection mode, determining if you can select a day, a week, or a month.

SelectMonthText

Gets/sets the text for the month selection element.

SelectorStyle

Gets the style for the week and month selector.

SelectWeekText

Gets/sets the text for week selection elements.

ShowDayHeader

Gets/sets whether the day of the week header is shown.

ShowGridLines

Gets/sets whether grid lines should appear between days.

ShowNextPrevMonth

Gets/sets whether to display next and previous month navigation controls.

ShowTitle

Gets/sets if the title should be displayed.

TitleFormat

Gets/sets the format for the title.

TitleStyle

Gets the style of the title.

TodayDayStyle

Gets the style for today's date.

TodaysDate

Gets/sets today's date.

VisibleDate

Gets/sets a date, making sure it's visible.

WeekendDayStyle

Gets the style for weekend dates.

Table 18.13: Noteworthy public events of Calendar objects.

Event

Means

DayRender

Occurs when each day is displayed.

SelectionChanged

Occurs when the user selects a date.

VisibleMonthChanged

Occurs when the user moves to a different month from the one currently displayed.

Previous Section Next Section




JavaScript Editor Free JavaScript Editor     JavaScript Editor