
834
|
Chapter 42: The System.Web.UI.WebControls Namespace
This is the Title of the Book, eMatter Edition
Copyright © 2008 O’Reilly & Associates, Inc. All rights reserved.
event fires once for each day in the Calendar, and it provides the CalendarDay object for that
day. At this point, you can modify its properties.
For example, you can compare dates against valid date ranges stored in a database and
set the IsSelectable property to False for all dates that you don’t want the user to be able to
select. Or you could examine the IsOtherMonth property to verify that the day is in the
currently displayed month and the IsWeekend property to confirm that the day is on a
weekend, and then change the background color of the containing cell to highlight it.
Note, however, that the background color is not a property of the CalendarDay object.
Instead, it is a property of the TableCell object that is also provided to you in the event
through the DayRenderEventArgs class. For more information, refer to the DayRenderEventArgs
object.
Returned By
DayRenderEventArgs.Day
Passed To
Calendar.OnDayRender( ), DayRenderEventArgs.DayRenderEventArgs( )
CalendarSelectionMode
System.Web.UI.WebControls (system.web.dll)
serializable
enum
This enumeration specifies the type of selection that a user can perform with a Calendar
control. Day allows the user to select a single day, DayWeek allows the user to select a
single day or an ...