This is a migrated thread and some comments may be shown as answers.

Timeline with custom attributes

1 Answer 104 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
David Penny
Top achievements
Rank 2
David Penny asked on 09 Jan 2009, 02:52 PM
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:

<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

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 10 Jan 2009, 01:18 PM
Hi David,

Please, open a support ticket and send us a working demo of the issue. The code you provided here is not sufficient to diagnose the cause of the problem.

Regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Scheduler
Asked by
David Penny
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or