System.Web.UI.WebControls Namespace
Specifies the date selection method for a Calendar control.
Member Name |
Description |
Day |
Dates selected by individual days. |
DayWeek |
Dates selected by individual days or entire weeks. |
DayWeekMonth |
Dates selected by individual days, entire weeks, or entire months. |
None |
No dates can be selected. |
The CalendarSelectionMode enumeration represents the possible values that can be passed to the SelectionMode property of a Calendar control.
The following example demonstrates dynamically setting the SelectionMode property of a Calendar at run time, based on user input.
void Page_Load ( Object src, EventArgs e ) {
myCalendar.SelectionMode = ( CalendarSelectionMode ) lstSelMode.SelectedIndex;
if ( myCalendar.SelectionMode == CalendarSelectionMode.None )
myCalendar.SelectedDates.Clear ( );
}
Show me