I can't seem to figure out how to associate my SQL DataSource to a ResourceControl in a customized advanced form template. The examples online are not helping to figure this out. Can you tell me what I'm doing wrong in this code:
I get this error when I compile:
Cannot create an object of type 'System.Object' from its string representation '<% Bind("Department") %>' for the 'DepartmentID' property.
An example of associating a DataSourceID to a custom resource type would be most useful.
Thanks. Dan
<telerik:RadScheduler runat="server" ID="RadScheduler1" Skin="Vista" DataKeyField="ID" DataSubjectField="subject" DataStartField="start" DataEndField="end" Height="650px" Width="375px" SelectedView="DayView" ShowFooter="true" RowHeight="20px" ShowViewTabs="false" DayStartTime="08:00:00" DayEndTime="17:00:00" FirstDayOfWeek="Monday" LastDayOfWeek="Sunday" EnableDescriptionField="true" AppointmentStyleMode="Default" EnableResourceEditing="true" OnDataBound="RadScheduler1_DataBound" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound" OnClientFormCreated="schedulerFormCreated" OnAppointmentDelete="RadScheduler1_AppointmentDelete" OnAppointmentUpdate="RadScheduler1_AppointmentUpdate" OnAppointmentInsert="RadScheduler1_AppointmentInsert"> <AdvancedForm Modal="false" /> <TimelineView UserSelectable="false" /> <AppointmentTemplate> <div class="rsAptSubject"> <%# Eval("Subject") %> </div> </AppointmentTemplate> <TimeSlotContextMenuSettings EnableDefault="true" /> <AppointmentContextMenuSettings EnableDefault="true" /> <ResourceTypes> <telerik:ResourceType KeyField="CPK_CATEGORY" Name="Department" TextField="category" ForeignKeyField="DepartmentID" DataSourceID="dsTodoCategory" /> </ResourceTypes> <AdvancedEditTemplate> <scheduler:AdvancedForm runat="server" ID="AdvancedEditForm1" Mode="Edit" Subject='<%# Bind("Subject") %>' Description='<%# Bind("Description") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' RoomID='<%# Bind("Room") %>' DepartmentID='<% Bind("Department") %>' /> </AdvancedEditTemplate> <AdvancedInsertTemplate> <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Insert" Subject='<%# Bind("Subject") %>' Start='<%# Bind("Start") %>' End='<%# Bind("End") %>' Description='<%# Bind("Description") %>' RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' RoomID='<%# Bind("Room") %>' DepartmentID='<% Bind("Department") %>' /> </AdvancedInsertTemplate> </telerik:RadScheduler> In AdvancedForm.ascx: <asp:Panel runat="server" ID="ResourceControls"> <ul class="rsResourceControls"> <li> <scheduler:ResourceControl runat="server" ID="ResRoom" Type="Room" Label="Room:" Skin='<%# Owner.Skin %>' /> </li> <li> <scheduler:ResourceControl runat="server" ID="ResDepartment" Type="Department" Label="Department:" Skin='<%# Owner.Skin %>' /> </li> </ul> </asp:Panel>I get this error when I compile:
Cannot create an object of type 'System.Object' from its string representation '<% Bind("Department") %>' for the 'DepartmentID' property.
An example of associating a DataSourceID to a custom resource type would be most useful.
Thanks. Dan