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.
Assembly: System.Web (in System.Web.dll)
public: property CalendarSelectionMode SelectionMode { CalendarSelectionMode get (); void set (CalendarSelectionMode value); }
<asp:Calendar SelectionMode="CalendarSelectionMode" />
Property Value
Type: System.Web.UI.WebControls::CalendarSelectionModeOne 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.
| Topic | Location |
|---|---|
| How to: Control User Date Selection in a Calendar Web Server Control | Building ASP .NET Web Applications |
| How to: Control User Date Selection in a Calendar Web Server Control | Building ASP .NET Web Applications |
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.