Hi,
I'm trying to input schedule data into a RadScheduler that comes from a foreign system. For the purposes of this exercise let's just say it schedule data being imported into my App's SQL DB from another SQL server DB.
I have my own business object data layer and have an object called WorkSchedule which contains an instance of a class that contains multiple instances of another object called WorkScheduleTimeCollection (as an ArrayList). WorkScheduleTImeCollection in essence contains multiple instances of the class WorkScheduleTime (which is for all intents and purposes an object to represent an Appointment), this collection can thus be bound as a DataSource to RadScheduler.
When WorkScheduleTimeCollection is populated with data, an instance of a RadScheduler Recurrence Rule is created, both it and its string representation have been added as properties to the WorkScheduleTime Class. WorkScheduleTime also contains general data (like "Name" and "UniqueID"), as well as a StartTime and EndTime.
Also note I did find that formatting the RecurrenceRule string representation as discussed here: http://www.telerik.com/community/forums/aspnet-ajax/scheduler/daily-recurrence-string-is-correct.aspx to be useful.
Therefore I am attempting to bind this data to the RadScheduler as such:
In the code the first line simply retrieves the collection of "appointment" objects in the current schedule from a database method for the current visible range, and then it is bound to the RadScheduler
Here is an example of what kind of data would be in a typical WorkScheduleTime Appointment object, including the recurrence rule:
ID: 562
UniqueID: 562.008
Name: 562.008
DateActiveFrom: 1/1/2000 12:00:00 AM
DateActiveTo: 1/1/2099 12:00:00 AM
StartTime: 1/1/2000 12:34:00 PM (UTC)
EndTime: 1/1/2000 1:10:00 PM (UTC)
DayFrequency: M,T,W,U,F
RecurrenceRuleValue: DTSTART:20000101T000000Z/r/nDTEND:20000101T003600Z/r/nRRULE:FREQ=WEEKLY;UNTIL=20990101T000000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR/r/n
Here is (a simplified example of, but the same lines of code exist in the actual method of) how the recurrence rule is created, BTW:
Now my problem is, when the page loads all I get is one instance of each appointment created on the start date (DateActiveFrom) of the appointment and no others (it just so happens 1/1/2000 is a Saturday so the recurrence is truly not working correctly as these appointments almost always happen during the week as does the example). In essence the above example appointment does not recur every week day on M/W/T/U/F at 12:34p - 1:10p from 1/1/2000 - 1/1/2099. And at this point I'm not sure why.
The scheduler does see the appointment as a recurring appointment and will attempt to edit the individual occurence but If I try to "edit" the whole series the control breaks citing "not an instance of an object".
Any help would be appreciated, a trouble ticket can be submitted if that becomes necessary.
Thanks!
I'm trying to input schedule data into a RadScheduler that comes from a foreign system. For the purposes of this exercise let's just say it schedule data being imported into my App's SQL DB from another SQL server DB.
I have my own business object data layer and have an object called WorkSchedule which contains an instance of a class that contains multiple instances of another object called WorkScheduleTimeCollection (as an ArrayList). WorkScheduleTImeCollection in essence contains multiple instances of the class WorkScheduleTime (which is for all intents and purposes an object to represent an Appointment), this collection can thus be bound as a DataSource to RadScheduler.
When WorkScheduleTimeCollection is populated with data, an instance of a RadScheduler Recurrence Rule is created, both it and its string representation have been added as properties to the WorkScheduleTime Class. WorkScheduleTime also contains general data (like "Name" and "UniqueID"), as well as a StartTime and EndTime.
Also note I did find that formatting the RecurrenceRule string representation as discussed here: http://www.telerik.com/community/forums/aspnet-ajax/scheduler/daily-recurrence-string-is-correct.aspx to be useful.
Therefore I am attempting to bind this data to the RadScheduler as such:
With rsSchedule |
Dim stcWorkSchedule As New WorkScheduleTimeCollection stcWorkSchedule = Database.SelectWorkScheduleTimes(ScheduleUniqueID, .VisibleRangeStart, .VisibleRangeEnd, True) |
.DataSource = stcWorkSchedule |
.DataKeyField = "UniqueID" |
.DataSubjectField = "Name" |
.DataStartField = "StartTime" |
.DataEndField = "EndTime" |
.DataRecurrenceParentKeyField = "UniqueID" |
.DataRecurrenceField = "RecurrenceRuleValue" |
.DataBind() |
End With |
In the code the first line simply retrieves the collection of "appointment" objects in the current schedule from a database method for the current visible range, and then it is bound to the RadScheduler
Here is an example of what kind of data would be in a typical WorkScheduleTime Appointment object, including the recurrence rule:
ID: 562
UniqueID: 562.008
Name: 562.008
DateActiveFrom: 1/1/2000 12:00:00 AM
DateActiveTo: 1/1/2099 12:00:00 AM
StartTime: 1/1/2000 12:34:00 PM (UTC)
EndTime: 1/1/2000 1:10:00 PM (UTC)
DayFrequency: M,T,W,U,F
RecurrenceRuleValue: DTSTART:20000101T000000Z/r/nDTEND:20000101T003600Z/r/nRRULE:FREQ=WEEKLY;UNTIL=20990101T000000Z;INTERVAL=1;BYDAY=MO,TU,WE,TH,FR/r/n
Here is (a simplified example of, but the same lines of code exist in the actual method of) how the recurrence rule is created, BTW:
Private Function CreateRecurrenceRule(wstTime As WorkScheduleTime) As WorkScheduleTime |
With wstTime |
Dim rrRange As New RecurrenceRange() |
rrRange.Start = .DateActiveFrom |
rrRange.RecursUntil = .DateActiveTo |
rrRange.EventDuration = .EndTime - .StartTime |
'Here ".DayFrequency" is a class of boolean values representing the 7 character comma delimited day 'frequency list I receive from the foreign schedule data, that class is "converted" to the Telerik 'RecurrenceDay object. |
Dim rdDays As RecurrenceDay = Me.BuildScheduleDayRecurrence(.DayFrequency) |
Dim wrRule As New WeeklyRecurrenceRule(1, rdDays, rrRange) |
.RecurrenceRule = wrRule |
.RecurrenceRuleValue = wrRule.ToString |
.RecurrenceRuleValue = .RecurrenceRuleValue.Replace(vbCr, "/r") |
.RecurrenceRuleValue = .RecurrenceRuleValue.Replace(vbLf, "/n") |
End With |
Return wstTime |
End Sub |
Now my problem is, when the page loads all I get is one instance of each appointment created on the start date (DateActiveFrom) of the appointment and no others (it just so happens 1/1/2000 is a Saturday so the recurrence is truly not working correctly as these appointments almost always happen during the week as does the example). In essence the above example appointment does not recur every week day on M/W/T/U/F at 12:34p - 1:10p from 1/1/2000 - 1/1/2099. And at this point I'm not sure why.
The scheduler does see the appointment as a recurring appointment and will attempt to edit the individual occurence but If I try to "edit" the whole series the control breaks citing "not an instance of an object".
Any help would be appreciated, a trouble ticket can be submitted if that becomes necessary.
Thanks!