Results 1 to 3 of 3

Thread: Calendar Control (to show 2 weeks only)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    MA, US
    Posts
    78

    Calendar Control (to show 2 weeks only)

    Hi,

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

    Thank you,

    Sorin

  2. #2
    Addicted Member Dmyze's Avatar
    Join Date
    Mar 2002
    Location
    Seattle
    Posts
    160
    This should do the trick:

    Code:
      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
    Last edited by Dmyze; Jan 9th, 2003 at 03:17 PM.
    -Daryl
    "Two More Rolls of Duct tape, and the world is mine!"
    VB.NET Guru

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2001
    Location
    MA, US
    Posts
    78
    Very cool solution.

    Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width