Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Asp.Net/Javascript Calander Control

  • 03-06-2009 01:07PM
    #1
    Registered Users, Registered Users 2 Posts: 1,943 ✭✭✭


    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,267 ✭✭✭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,943 ✭✭✭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