Recurring Events with Calendar

2 posts, 0 answers
  1. Matthew
    Matthew avatar
    4 posts
    Member since:
    Oct 2007

    Posted 02 Oct 2008 Link to this post

    Currently, I am creating calendars at runtime with my application. below is the code that I am using to do this...

     Dim newCalendar As New Telerik.Web.UI.RadCalendar
                newCalendar.Skin = "WebBlue"
                newCalendar.RowHeaderText = " "
                newCalendar.AutoPostBack = True
                newCalendar.PresentationType = UI.Calendar.PresentationType.Preview
                'fill the calendar with other information associated with the user
                'get selected dates
                Dim dtUserCalendar As DataTable = oDB.GetUserSpecificCalendar(dtCalendars.Rows(intloop).Item("EmpID"))
                For intloop2 As Integer = 0 To dtUserCalendar.Rows.Count - 1
                    Dim dateTasks() As Date = GetDateArray(dtUserCalendar.Rows(intloop2).Item("Start"), dtUserCalendar.Rows(intloop2).Item("End"))
                    For intloop3 As Integer = 0 To dateTasks.Length - 1
                        Dim userDate As New Telerik.Web.UI.RadDate
                        userDate.Date = dateTasks(intloop3)

    When I create the calendar, I want all days the user is busy to be highlighted. This code will do this just fine. The problem that I am having is when a user enters in a recurring event. For example, if the user enters in a recurring event to start on October 1st and it occurs once every week from that point on, my calendar will only highlight October 1st and not any of the other days that the appointment is scheduled to happen on. Is this even possible to do with the Calendar control? If so, what do I need to do to get it to work for me.

  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 06 Oct 2008 Link to this post


    RadCalendar does not direclty support recurrence, but RadScheduler has full recurrence support, including some handy utilities that are used to calculate recurence patterns and rules. You should be able to use the server side programming techniques shown in this RadScheduler topic to take a recurence rule and expand it to get a list of dates:

    With those dates in hand, you can use your normal RadCalendar code to color cells accordingly.

    Hope that helps.

Back to Top