Hi I have read this thread http://www.telerik.com/help/aspnet-ajax/schedule_appearancetemplates.html on using templates I would like to be able to use the radio buttons to assign the job to a dept
when I load the page I get the following error
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
this is my aspx
VB
thanks
M
when I load the page I get the following error
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
this is my aspx
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <%@ Register assembly="System.Web.Ajax" namespace="System.Web.UI" tagprefix="asp" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head id="Head1" runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <AppointmentTemplate> |
| <div class="rsCustomAppointmentContainer <%# Eval("AppointmentType.Text") %>"> |
| <h2><%# Eval("Subject") %> |
| <asp:AjaxScriptManager ID="AjaxScriptManager1" runat="server"> |
| </asp:AjaxScriptManager> |
| </h2> |
| </div> |
| </AppointmentTemplate> |
| <telerik:RadScheduler ID="RadScheduler1" runat="server" |
| CustomAttributeNames="fileUpload" DataDescriptionField="jobDescription" |
| DataEndField="jobEnd" DataKeyField="jobId" DataSourceID="SqlDataSource1" |
| DataStartField="jobLive" DataSubjectField="jobName" Skin="Windows7"> |
| <ResourceStyles> |
| <telerik:ResourceStyleMapping ApplyCssClass="" Key="fileUpload" Text="" |
| Type="url" /> |
| </ResourceStyles> |
| </telerik:RadScheduler> |
| <asp:SqlDataSource ID="SqlDataSource1" runat="server" |
| ConnectionString="<%$ ConnectionStrings:JT2010ConnectionString %>" |
| SelectCommand="SELECT [jobId], [jobName], [jobType], [jobLive], [jobEnd], [jobDescription], [fileUpload], [UserId], [jobStatus], [jobCreated] FROM [Jobs] WHERE ([jobStatus] = @jobStatus)"> |
| <SelectParameters> |
| <asp:Parameter DefaultValue="New" Name="jobStatus" Type="String" /> |
| </SelectParameters> |
| </asp:SqlDataSource> |
| <InlineInsertTemplate> |
| <div id="InlineInsertTemplate" class="rsCustomAppointmentContainer <%# Eval("AppointmentType.Text") %>"> |
| <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>' Width="90%" TextMode="MultiLine" Height="20px"></asp:TextBox> |
| <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert"> |
| <asp:Image runat="server" ID="insertImage" ImageUrl="Images/ok.gif" AlternateText="insert" /> |
| </asp:LinkButton> |
| <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"> |
| <asp:Image runat="server" ID="Image2" ImageUrl="Images/cancel.gif" AlternateText="cancel" /> |
| </asp:LinkButton> |
| <div class="inline-label">Color code:</div> |
| <asp:RadioButtonList runat="server" ID="AppointmentTypeRadioButtonList" |
| DataValueField="type" CssClass="AppointmentTypeSelectorTable" |
| DataSourceID="SqlDataSource2" SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="type" |
| RepeatDirection="Horizontal" |
| DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}' onclick='onAppointmentTypeSelectorClick'></span>"> |
| </asp:RadioButtonList> |
| <asp:SqlDataSource ID="SqlDataSource2" runat="server" |
| ConnectionString="<%$ ConnectionStrings:JT2010ConnectionString %>" |
| SelectCommand="SELECT [id], [type] FROM [JobType]"></asp:SqlDataSource> |
| <asp:LinkButton ID="InsertMoreButton" runat="server" CommandName="More" CssClass="rsAdvancedEditLink">Advanced</asp:LinkButton> |
| </div> |
| </InlineInsertTemplate> |
| <InlineEditTemplate> |
| <div id="InlineEditTemplate" class="rsCustomAppointmentContainer <%# Eval("AppointmentType.Text") %>"> |
| <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Subject") %>' Width="90%" TextMode="MultiLine" Height="20px"></asp:TextBox> |
| <asp:LinkButton ID="LinkButton3" runat="server" CommandName="Update"> |
| <asp:Image runat="server" ID="Image6" ImageUrl="Images/ok.gif" AlternateText="update" /> |
| </asp:LinkButton> |
| <asp:LinkButton ID="LinkButton4" runat="server" CausesValidation="False" CommandName="Cancel"> |
| <asp:Image runat="server" ID="Image7" ImageUrl="Images/cancel.gif" AlternateText="cancel" /> |
| </asp:LinkButton> |
| <div class="inline-label">Color code:</div> |
| <asp:RadioButtonList runat="server" ID="RadioButtonList3" DataValueField="type" CssClass="AppointmentTypeSelectorTable" |
| DataSourceID="SqlDataSource2" SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="type" |
| RepeatDirection="Horizontal" |
| DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}' onclick='onAppointmentTypeSelectorClick'></span>"> |
| </asp:RadioButtonList> |
| <asp:LinkButton ID="LinkButton5" runat="server" CommandName="More" CssClass="rsAdvancedEditLink">Advanced</asp:LinkButton> |
| </div> |
| </InlineEditTemplate> |
| </div> |
| </form> |
| </body> |
| </html> |
VB
| Imports System.Web |
| Imports System.Web.UI.HtmlControls |
| Imports System.Web.UI.WebControls |
| Imports System.Web.ApplicationServices |
| Partial Class users_Default4 |
| Inherits System.Web.UI.Page |
| Protected Sub RadScheduler1_FormCreated(ByVal sender As Object, _ |
| ByVal e As SchedulerFormCreatedEventArgs) |
| If e.Container.Mode = SchedulerFormMode.Insert Then |
| Dim list As RadioButtonList = _ |
| DirectCast(e.Container.FindControl("AppointmentTypeRadioButtonList"), _ |
| RadioButtonList) |
| list.SelectedIndex = 0 |
| End If |
| End Sub |
| End Class |
thanks
M