This is a migrated thread and some comments may be shown as answers.

Recurring Events with Calendar

1 Answer 116 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 02 Oct 2008, 08:20 PM
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)
                    newCalendar.SelectedDates.Add(userDate)
                Next
            Next

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.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 06 Oct 2008, 07:36 PM
Matthew-

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.

-Todd
Tags
Calendar
Asked by
Matthew
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or