Here's a bit more info of how I have it set up:
My RadScheduleView:
ResourceTypes which is bound to ResourceTypeSource is set in the MainPageViewModel.cs:
When the RadComboBox selection is changed the following runs:
// the radlistbox is populated and the GetMyResources_Completed is called
void GetMyResources_Completed()
{
// Update resource types for scheduleview
UpdateResourceTypes();
// load Appointments after the resource list was updated
ServiceAgent.GetMyAppointments(CurrentVisibleDateRange as IDateSpan, SelectedSiteId, appointments, ResourceItemList, AppointmentTypeList);
}
void UpdateResourceTypes()
{
ObservableCollection<
ResourceType
> restype = new ObservableCollection<
ResourceType
>();
ResourceType docType = new ResourceType("myResourceType");
foreach (ResourceItem ri in ResourceItemList)
{
docType.Resources.Add(new Resource(ri.Name));
}
restype.Add(docType);
ResourceTypes = restype;
if (CurrentVisibleDateRange == null)
{
DateSpan dsDate = new DateSpan();
dsDate.Start = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
dsDate.End = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day + 1);
CurrentVisibleDateRange = dsDate;
}
}
Currently, it is not grouping the myResourceType even though I have the GroupDescriptionCollection set to it. I'm assuming it's how/when the resource is being created in the code behind.
How can I dynamically populate this resource and have it group for the appointments in codebehind?
Thanks,
Tim