Name
CalendarDay
Synopsis
This class represents a single day in the Calendar
control. You can use this class
in the Calendar.DayRender
event to
programmatically configure specific dates. The Calendar.DayRender
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.
Public Class CalendarDay ' Public Constructors Public Sub New(ByVal date As Date, ByVal isWeekend As Boolean, ByVal isToday As Boolean, ByVal isSelected As Boolean, ByVal isOtherMonth As Boolean, ByVal dayNumberText As String) ' Public Instance Properties Public ReadOnly Property Date As Date Public ReadOnly Property DayNumberText As String Public ReadOnly Property IsOtherMonth As Boolean Public Property IsSelectable As Boolean ...
Get ASP.NET in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.