Disabling past days in a calendar extender (make them unclickable)

Rate It (1)

Last post 04-09-2007 12:05 PM by AlyssaPresley. 2 replies.

Sort Posts:

  • Disabling past days in a calendar extender (make them unclickable)

    03-31-2007, 9:02 PM
    • Member
      105 point Member
    • AlyssaPresley
    • Member since 06-02-2004, 12:20 PM
    • Posts 30

    Does anyone know how to disable dates in the past using a calendar extender? 

     

    Optimally, I'd like the dates to be non-clickable -- currently any date can be clicked and it can potentially be confusing.  The only prevention I have is adding a range validator to test for a past date.  Serves the purpose but the best thing to do is have past days unclickable.

     

    Any ideas? 

    ASP.net Damsal in Distress
    Filed under:
  • Re: Disabling past days in a calendar extender (make them unclickable)

    04-04-2007, 6:03 PM
    • Member
      105 point Member
    • AlyssaPresley
    • Member since 06-02-2004, 12:20 PM
    • Posts 30

    anybody?  I can't be the only one who needs this functionality.  Haven't found much on it anywhere on the web.

     

    Thx !!

     

    ASP.net Damsal in Distress
  • Re: Disabling past days in a calendar extender (make them unclickable)

    04-09-2007, 12:05 PM
    • Member
      105 point Member
    • AlyssaPresley
    • Member since 06-02-2004, 12:20 PM
    • Posts 30

    My only solution to this has been NOT to use a CalendarExtender at all.

    Instead, use a PopUpControlExtender with a ASP.net calendar embedded in its own UpdatePanel.  Then disable the dates in DayRender event.

     

     Protected Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs)
            If e.Day.Date < Today Then
                e.Day.IsSelectable = False
                e.Cell.BackColor = Drawing.Color.LightGray
                e.Cell.ForeColor = Drawing.Color.White
            End If
        End Sub

     A lot more work.
     

    ASP.net Damsal in Distress
Page 1 of 1 (3 items)