Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Asp.Net/Javascript Calander Control

Options
  • 03-06-2009 1:07pm
    #1
    Registered Users Posts: 1,930 ✭✭✭


    Hi all,

    Does anybody know of a control (third party even) - that allows you to pass a collection of dates - and only those dates are then clickable???

    All the controls that I have seen so far allow min and max date only.


    Thanks,
    Keith.


Comments

  • Registered Users Posts: 1,266 ✭✭✭00sully


    you can implement the DayRender method for the standard asp.net 2.0 calendar (not sure about the ajax one) here is an example that does a range from 1st november to current day -1 - other cells are greyed out and not selectable. you could modify this to pass in a collection of dates easy enough.
    Private Sub myCal_DayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs) Handles myCal.DayRender
            If e.Day.Date < New Date(2007, 11, 1) Then
                e.Cell.BackColor = System.Drawing.Color.LightGray
                e.Day.IsSelectable = False
            End If
    
            If e.Day.Date = myCal.SelectedDate Then //if day is already selected
                e.Day.IsSelectable = False
            End If
    
            If e.Day.Date > DateTime.Today.AddDays(-1.0) Then
                e.Cell.BackColor = System.Drawing.Color.LightGray
                e.Day.IsSelectable = False
            End If
    
        End Sub
    


  • Registered Users Posts: 1,930 ✭✭✭keith_d99


    That's the one 00Sully! Yeah found it yesterday - customer uses 1.1 but still works using 1.1's control - must look at implementing it inside an Ajax panel

    Glad to not have gone down the road of 3rd party controls!


Advertisement