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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Asp.Net/Javascript Calander Control

  • 03-06-2009 12:07pm
    #1
    Registered Users, Registered Users 2 Posts: 1,933 ✭✭✭


    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, Registered Users 2 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, Registered Users 2 Posts: 1,933 ✭✭✭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