Calendar::SelectionMode Property

 

Gets or sets the date selection mode on the Calendar control that specifies whether the user can select a single day, a week, or an entire month.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

public:
property CalendarSelectionMode SelectionMode {
	CalendarSelectionMode get();
	void set(CalendarSelectionMode value);
}

Property Value

Type: System.Web.UI.WebControls::CalendarSelectionMode

One of the CalendarSelectionMode values. The default value is Day.

Exception Condition
ArgumentOutOfRangeException

The specified selection mode is not one of the CalendarSelectionMode values.

Use the SelectionMode property to specify the date selection mode on the Calendar control. This property is set with one of the CalendarSelectionMode enumeration values. You can specify whether the user can select a single day, a week, or an entire month, or you can disable date-selection capability entirely.

When this property is set to CalendarSelectionMode.DayWeek or CalendarSelectionMode.DayWeekMonth, an additional selector column that contains week and month selection controls is displayed in the first column of the Calendar control. Use the SelectorStyle property to customize the appearance of this column.

To disable date selection, set this property to CalendarSelectionMode.None.

The following code example demonstrates how to use the SelectionMode property to allow date selection by a single day, a week, or an entire month.

No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show: