Hi,
I'm not sure if thisis an issue or something I am doing wrong (on past experience, almost certainly the latter).
I have a RadScheduler which is populated manually. The definition is:
I also have an Object data source for the Resources:
I then populate the Scheduler using the following code:
If I remove all references to the Resources, then the Scheduler shows all of the Events exactly as expected. But when I add the Resources section the Scheduler does not show anything at all, and certainly does not show the expected Resource Grouping.
Is my code correct or is there something wrong with my approach?
David Penny
I'm not sure if thisis an issue or something I am doing wrong (on past experience, almost certainly the latter).
I have a RadScheduler which is populated manually. The definition is:
<telerik:RadScheduler ID="RadScheduler1" runat="server" CustomAttributeNames="Notes,ProjectID,OutOfOffice,Leave,Flexitime,StaffRef" |
DataEndField="End" DataKeyField="ID" DataStartField="Start" DataSubjectField="Subject" |
DayHeaderDateFormat="dddd dd MMMM yyyy" |
EnableCustomAttributeEditing="True" |
MonthVisibleAppointmentsPerDay="6" OnClientAppointmentEditing="AppointmentEditing" |
OnClientAppointmentInserting="AppointmentInserting" StartEditingInAdvancedForm="False" |
Style="top: 0px; left: 0px" ValidationGroup="RadScheduler1" Height="100%" |
Width="100%" WeekHeaderDateFormat="dd/MM/yy" HoursPanelTimeFormat="htt"> |
<TimelineView GroupBy="Resource" GroupingDirection="Vertical" /> |
<AppointmentTemplate> |
<div style="text-align: center; background-color: #ECECC6; font-weight: bold"> |
<%# Eval("Subject") %> |
</div> |
<%#Eval("Notes")%></AppointmentTemplate> |
<MonthView VisibleAppointmentsPerDay="6" /> |
<WeekView HeaderDateFormat="dd/MM/yy" /> |
<Localization ConfirmDeleteText="Are you sure you want to delete this entry" ConfirmDeleteTitle="" /> |
<DayView HeaderDateFormat="dddd dd MMMM yyyy" /> |
<ResourceTypes> |
<telerik:ResourceType DataSourceID="dsResources" ForeignKeyField="StaffID" |
KeyField="StaffID" Name="Resource" TextField="StaffReference" /> |
</ResourceTypes> |
</telerik:RadScheduler> |
I also have an Object data source for the Resources:
<asp:ObjectDataSource ID="dsResources" runat="server" |
SelectMethod="ListStaffByGroupAndTeam" TypeName="dbStaff"> |
<SelectParameters> |
<asp:Parameter DefaultValue="" Name="Group2" Type="String" /> |
<asp:ControlParameter ControlID="lblTeam" DefaultValue="" Name="Team" |
PropertyName="Text" Type="String" /> |
</SelectParameters> |
</asp:ObjectDataSource> |
I then populate the Scheduler using the following code:
Dim dateFrom As DateTime = RadScheduler1.VisibleRangeStart |
Dim dateTo As DateTime = RadScheduler1.VisibleRangeEnd |
Dim ev As New dbEvent |
Dim dt As New DataTable |
dsResources.DataBind() |
dt = ev.ReadEvents(dateFrom, dateTo, lblTeam.Text, 0, True, True) |
RadScheduler1.DataKeyField = "ID" |
RadScheduler1.DataStartField = "Start" |
RadScheduler1.DataEndField = "End" |
RadScheduler1.DataSubjectField = "Subject" |
RadScheduler1.Attributes("Notes") = "Notes" |
RadScheduler1.Attributes("ProjectID") = "ProjectID" |
RadScheduler1.Attributes("OutOfOffice") = "OutOfOffice" |
RadScheduler1.Attributes("Leave") = "Leave" |
RadScheduler1.Attributes("Flexitime") = "Flexitime" |
RadScheduler1.Attributes("StaffRef") = "StaffRef" |
RadScheduler1.DataSource = dt |
RadScheduler1.DataBind() |
If I remove all references to the Resources, then the Scheduler shows all of the Events exactly as expected. But when I add the Resources section the Scheduler does not show anything at all, and certainly does not show the expected Resource Grouping.
Is my code correct or is there something wrong with my approach?
David Penny