PDA

Click to See Complete Forum and Search --> : Calendar Control (to show 2 weeks only)


svatasoiu
Jan 9th, 2003, 03:11 AM
Hi,

It is possible to make the Calendar control to show only two weeks from today?

Thank you,

Sorin

Dmyze
Jan 9th, 2003, 02:11 PM
This should do the trick:



Private Sub cal_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles cal.DayRender

If e.Day.Date > Now.AddDays(15) Then
e.Cell.Text = ""
End If

If e.Day.Date < Now.ToShortDateString Then
e.Cell.Text = ""
End If

End Sub

svatasoiu
Jan 9th, 2003, 04:00 PM
Very cool solution.

Thank you very much.