I've built a Scheduler with a custom advanced form template which works perfect in a plain webform scenario using the Telerik Q3 2009. Once I place it in the webpart renders fine except when trying to show the custom advanced form template. It errors out in the Telerik.Web.UI.WebResource.axd line 1440 with a javascript error " TypeError Object has no method 'show'." Telerik.Web.UI.RadAjaxManager.ShowLoadingPanels. I'm guessing there is a conflict with webparts and the scheduler. This isn't associated with Sharepoint webparts or any other technology. Just straight asp.net webparts. Ok so now with the code:
| <%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="User.aspx.vb" Inherits="Page_User_User" %> |
| <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> |
| <asp:WebPartManager ID="wpm1" runat="server"> |
| <Personalization Enabled="true" InitialScope="User" /> |
| <StaticConnections> |
| <asp:WebPartConnection ID="wpc5" ConsumerConnectionPointID="MyConsumerID" ProviderConnectionPointID="MyProviderID" ProviderID="ucProfile" ConsumerID="ucJobEvent"/> |
| </StaticConnections> |
| </asp:WebPartManager> |
| <div class="grid_7"> |
| <asp:WebPartZone ID="wpz3" runat="server"> |
| <PartStyle ForeColor="White" /> |
| <PartTitleStyle ForeColor="White" Font-Bold="true" Height="32px" /> |
| <ZoneTemplate> |
| <ck:viewCart ID="ucCart" runat="server" /> |
| <ck:viewProduct ID="ucProduct" runat="server" /> |
| <ck:viewJob ID="ucJobEvent" runat="server" /> |
| </ZoneTemplate> |
| </asp:WebPartZone> |
| </div> |
| </asp:Content> |
| <%@ Control Language="VB" AutoEventWireup="false" CodeFile="view_Job.ascx.vb" Inherits="UserControl_View_Commerce_view_Job" %> |
| <%@ Register TagPrefix="scheduler" TagName="AdvancedForm" Src="~/UserControl/View/Commerce/JobControls/AdvancedForm.ascx" %> |
| <rad:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server"> |
| <AjaxSettings> |
| <rad:AjaxSetting AjaxControlID="gridEvent"> |
| <UpdatedControls> |
| <rad:AjaxUpdatedControl ControlID="gridEvent" /> |
| </UpdatedControls> |
| </rad:AjaxSetting> |
| </AjaxSettings> |
| </rad:RadAjaxManagerProxy> |
| <rad:RadScriptBlock ID="ScriptBlock" runat="server"> |
| <script type="text/javascript" language="javascript"> |
| //<![CDATA[ |
| // Dictionary containing the advanced template client object |
| // for a given RadScheduler instance (the control ID is used as key). |
| var schedulerTemplates = {}; |
| function schedulerFormCreated(scheduler, eventArgs) { |
| // Create a client-side object only for the advanced templates |
| var mode = eventArgs.get_mode(); |
| if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert || |
| mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) { |
| // Initialize the client-side object for the advanced form |
| var formElement = eventArgs.get_formElement(); |
| var templateKey = scheduler.get_id() + "_" + mode; |
| var advancedTemplate = schedulerTemplates[templateKey]; |
| if (!advancedTemplate) { |
| // Initialize the template for this RadScheduler instance |
| // and cache it in the schedulerTemplates dictionary |
| var schedulerElement = scheduler.get_element(); |
| var isModal = scheduler.get_advancedFormSettings().modal; |
| advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal); |
| advancedTemplate.initialize(); |
| schedulerTemplates[templateKey] = advancedTemplate; |
| // Remove the template object from the dictionary on dispose. |
| scheduler.add_disposing(function() { |
| schedulerTemplates[templateKey] = null; |
| }); |
| } |
| // Are we using Web Service data binding? |
| if (!scheduler.get_webServiceSettings().get_isEmpty()) { |
| // Populate the form with the appointment data |
| var apt = eventArgs.get_appointment(); |
| var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert; |
| var editSeries = eventArgs.get_editingRecurringSeries(); |
| advancedTemplate.populate(apt, isInsert, editSeries); |
| } |
| } |
| } |
| //]]> |
| </script> |
| </rad:RadScriptBlock> |
| <rad:RadScheduler ID="gridEvent" runat="server" |
| DataSourceID="cslaJobEvent" |
| DataStartField="Start" |
| DataEndField="End" |
| DataSubjectField="Subject" |
| DataDescriptionField="Description" |
| DataKeyField="ID" |
| DataRecurrenceField="RecurrenceRule" |
| DataRecurrenceParentKeyField="RecurrenceParentID" |
| OverflowBehavior="Expand" |
| ShowDateHeaders="False" |
| ShowViewTabs="False" |
| Skin="Black" |
| StartInsertingInAdvancedForm="True" |
| StartEditingInAdvancedForm="true" |
| NumberOfHoveredRows="1" |
| RegisterWithScriptManager="true" |
| OnClientFormCreated="schedulerFormCreated" |
| CustomAttributeNames="EventFee,ContractFee,Allowance,Airline,CarRental,Hotel,IsPrivate,Color" |
| EnableDescriptionField="True"> |
| <AdvancedForm Enabled="true" Modal="True" ZIndex="2500" EnableCustomAttributeEditing="true" /> |
| <AppointmentTemplate> |
| <h4><%#Eval("Subject")%></h4> |
| <asp:ImageButton ID="btnEvent" runat="server" ImageAlign="Left" ImageUrl='<%#Eval("ImageName") %>' /> |
| <%#Eval("EventFee", "{0:c}")%> |
| <%#Eval("EventDesc")%> |
| </AppointmentTemplate> |
| <AdvancedInsertTemplate> |
| <scheduler:AdvancedForm ID="AdvanceInsertForm1" runat="server" |
| Mode="Insert" |
| Subject='<%# Bind("Subject") %>' |
| Description='<%# Bind("Description") %>' |
| Start='<%# Bind("Start") %>' |
| End='<%# Bind("End") %>' |
| RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' |
| EventFee='<%# Bind("EventFee") %>' |
| ContractFee='<%# Bind("ContractFee") %>' |
| Airline='<%# Bind("Airline") %>' |
| CarRental='<%# Bind("CarRental") %>' |
| Hotel='<%# Bind("Hotel") %>' |
| IsPrivate='<%# Bind("IsPrivate") %>' |
| AppointmentColor='<%# Bind("Color") %>' /> |
| </AdvancedInsertTemplate> |
| <AdvancedEditTemplate> |
| <scheduler:AdvancedForm ID="AdvanceEditForm1" runat="server" |
| Mode="Edit" |
| Subject='<%# Bind("Subject") %>' |
| Description='<%# Bind("Description") %>' |
| Start='<%# Bind("Start") %>' |
| End='<%# Bind("End") %>' |
| RecurrenceRuleText='<%# Bind("RecurrenceRule") %>' |
| EventFee='<%# Bind("EventFee") %>' |
| ContractFee='<%# Bind("ContractFee") %>' |
| Airline='<%# Bind("Airline") %>' |
| CarRental='<%# Bind("CarRental") %>' |
| Hotel='<%# Bind("Hotel") %>' |
| IsPrivate='<%# Bind("IsPrivate") %>' |
| AppointmentColor='<%# Bind("Color") %>' /> |
| </AdvancedEditTemplate> |
| <ResourceTypes> |
| <rad:ResourceType Name="Name" TextField="CoWorkerName" KeyField="CoWorkerID" ForeignKeyField="ID" AllowMultipleValues="True" /> |
| </ResourceTypes> |
| <MonthView UserSelectable="False" /> |
| <TimelineView UserSelectable="False" /> |
| <DayView ShowResourceHeaders="False" /> |
| <WeekView UserSelectable="False" /> |
| </rad:RadScheduler> |
| <csla:CslaDataSource ID="cslaJobEvent" runat="server" TypeAssemblyName="" TypeName="CK.Library.JobEventPostList, CK.Library" TypeSupportsPaging="True" TypeSupportsSorting="True" /> |
| <csla:CslaDataSource ID="cslaCoworker" runat="server" TypeAssemblyName="" TypeName="CK.Library.CoworkerList, CK.Library" TypeSupportsPaging="True" TypeSupportsSorting="True" /> |