Hi,
I am trying to group my RadScheduler by a resource (Staff). The scheduler has appointments on it and the appointments have resources added by the provider. However, as soon as I add GroupBy="Staff" to the markup, I get no appointments displaying and the scheduler only shows the "all day" row. Interrestingly, a breakpoint in the AppointmentsPopulating method shows the appointments (with the correct resources) but the AppointmentCreated method never fires.
Below is how I've set up the provider to add the Staff resource.
In my provider I have a dictionary defined this way "Private dictResources As IDictionary(Of ResourceType, IEnumerable(Of Resource))" which the GetAppointments method populates like this:
The GetStaffResources method contains the following:
Finally, LoadResource (which is called from GetAppointments just before the Appointment is added to the list of appointments) looks like this:
As I said, all this works fine until I try to group by "Staff" and then no appointments get to the page. In fact, no TimeSlots get to the page either except the AllDay row. Any help you can provide regarding what could be the cause of this symptom would be appreciated.
Thanks,
Danny
I am trying to group my RadScheduler by a resource (Staff). The scheduler has appointments on it and the appointments have resources added by the provider. However, as soon as I add GroupBy="Staff" to the markup, I get no appointments displaying and the scheduler only shows the "all day" row. Interrestingly, a breakpoint in the AppointmentsPopulating method shows the appointments (with the correct resources) but the AppointmentCreated method never fires.
Below is how I've set up the provider to add the Staff resource.
In my provider I have a dictionary defined this way "Private dictResources As IDictionary(Of ResourceType, IEnumerable(Of Resource))" which the GetAppointments method populates like this:
Select Case strType.ToUpper() Case "STAFF" typType = New ResourceType(strType, True) lstResource = GetStaffResources(myInfo.intSite_pKey)End SelectIf Not lstResource Is Nothing Then GetResources.Add(typType, lstResource)The GetStaffResources method contains the following:
For Each dr As DataRow In dt.Rows Dim pKey As Integer = dr.Item(dt.Columns.IndexOf("pKey")) Dim Contact_pKey As Integer = dr.Item(dt.Columns.IndexOf("Contact_pKey")) Dim Name As String = dr.Item(dt.Columns.IndexOf("Fullname")) Dim item As New clsSchedResStaff() item.pKey = pKey item.Contact_pKey = Contact_pKey item.Name = Name Dim res As New Resource res.Key = item.pKey res.Text = item.Name res.DataItem = item res.Type = "Staff" GetStaffResources.Add(res)NextFinally, LoadResource (which is called from GetAppointments just before the Appointment is added to the list of appointments) looks like this:
Private Sub LoadResources(apt As Appointment) Dim arrStaffPKeys As String() = apt.Attributes("StaffPKeys").Split(";") For Each pairResource As KeyValuePair(Of ResourceType, IEnumerable(Of Resource)) In dictResources Dim lstResources As List(Of Resource) = pairResource.Value.ToList() Dim strType As String = pairResource.Key.Name.ToUpper() For Each theResource As Resource In lstResources Select Case strType Case "STAFF" Dim item As clsSchedResStaff = DirectCast(theResource.DataItem, clsSchedResStaff) If arrStaffPKeys.Contains(item.Contact_pKey) Then apt.Resources.Add(theResource) End If End Select Next NextEnd SubAs I said, all this works fine until I try to group by "Staff" and then no appointments get to the page. In fact, no TimeSlots get to the page either except the AllDay row. Any help you can provide regarding what could be the cause of this symptom would be appreciated.
Thanks,
Danny