Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Calendar control

Hello Everyone,

I have a questioon regarding the calendar control in asp.net.  Is there a way to make all days before today unselectable?
This calendar is for setting up demos, and I want the users to select only today or future days.

Thanks,
Newbie

Newbie
Friday, September 10, 2004

There is a DayRender event on the calendar control.  As each day is created you can modify its properties.

Example:

Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
        If e.Day.Date < Today() Then
            e.Day.IsSelectable = False
        End If
    End Sub

tjk
Friday, September 10, 2004

Thanks, that will help.

Newbie
Friday, September 10, 2004

*  Recent Topics

*  Fog Creek Home