I am attempting to use the ResourceView of the RadScheduler to show me the Appointments for specific resources. I have specified that the ForeignKey for the ResourceMapping is the ResourceID field which is a CustomAttribute of the Appointment object. I have verified that the data for the ResourceID field is being correctly populated in the Appointment and I have also verified that the resources are being bound to the control. My question is this: when I try to use the ResourceView, I can see the resources, but none of the Appoinments that use those Resources. Am I missing something for the relationship between these two to make this work? Below is the code(s) I am using to establish the relationship:
| <ResourceTypes> |
| <telerik:ResourceType |
| ForeignKeyField="ResourceID" |
| DataSourceID="odsResources" |
| Name="Route" |
| KeyField="Id" |
| TextField="RouteName" /> |
| </ResourceTypes> |
The code that populates the Appoinment object is below:
| appts = new List<TelerikAppointment>(); |
| foreach (Schedule s in schedules) |
| { |
| temp = new Appointment(); |
| temp.Attributes["ResourceID"] = s.Route.Id.ToString(); |
| temp.Attributes["MobilityID"] = s.Appointment.Mobility.Id.ToString(); |
| temp.Attributes["FromID"] = s.Appointment.FromAddress.Id.ToString(); |
| temp.Attributes["ToID"] = s.Appointment.ToAddress.Id.ToString(); |
| temp.End = s.EndTime; |
| temp.ID = s.Id; |
| temp.Start = s.StartTime; |
| temp.Subject = s.Description; |
| appts.Add(temp); |
| } |
| this.RadScheduler1.DataSource = appts; |
The RadScheduler control has defined the custom attributes and the group by in the control declaration. Below is the abbreviated control declaration:
| CustomAttributeNames="ResourceID,MobilityID,FromID,ToID" |
| DataEndField="End" |
| DataKeyField="ID" |
| DataStartField="Start" |
| DataSubjectField="Subject" |
| DayEndTime="22:00:00" |
| DayStartTime="05:00:00" |
| EnableCustomAttributeEditing="true" |
| FirstDayOfWeek="Sunday" |
| GroupBy="Route" |
Again, when I switch to the ResourceView, I can see the resources, there simply aren't any appointments assigned to the resources.
Thanks in advance!