Update RecurenceEditor using AJAX

3 posts, 0 answers
  1. Hemika
    Hemika avatar
    38 posts
    Member since:
    Dec 2012

    Posted 01 Jan 2013 Link to this post

    I have customized the appointment editing window to show in a RadDock as a pop-up. When I double click on an appointment, my customized form will be show. The application is running on SharePoint 2010

    Heres the c# code..

    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatingEventArgs e)
                if (e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.Edit)
                    e.Cancel = true;
                Telerik.Web.UI.Appointment appointmentToEdit = RadScheduler1.PrepareToEdit(e.Appointment, RadScheduler1.EditingRecurringSeries);
                ScriptManager.RegisterClientScriptBlock(Page, GetType(), "formScript", "Sys.Application.add_load(openDoubleClickForm);", true);
            private void PopulateEditForm(Telerik.Web.UI.Appointment editedAppointment)
                Telerik.Web.UI.Appointment appointmentToEdit = RadScheduler1.PrepareToEdit(editedAppointment, RadScheduler1.EditingRecurringSeries);
                radPopSplitDuration.Value = appointmentToEdit.Duration.TotalHours;
                RecurrenceRule parsedRule;
                RecurrenceRule.TryParse(appointmentToEdit.RecurrenceRule, out parsedRule);
                appointmentRecurrenceEditor.RecurrenceRule = parsedRule;
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(this.RadScheduler1, radPopSplitDuration);
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(this.RadScheduler1, appointmentRecurrenceEditor);

    Ajax Manager in my page...
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" EnableAJAX="true">
                <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                <telerik:AjaxSetting AjaxControlID="radPopSplitDuration">
                        <telerik:AjaxUpdatedControl ControlID="radPopSplitDuration" />
                <telerik:AjaxSetting AjaxControlID="appointmentRecurrenceEditor">
                        <telerik:AjaxUpdatedControl ControlID="appointmentRecurrenceEditor" />

    <asp:Panel runat="server" ID="DockPanel">
            <telerik:RadDock runat="server" ID="RadDock1" Width="650px" Height="530px" Closed="true"
                Style="z-index: 2000;" Title="<%$Resources:MyResources, SplitDetailsTitle%>">
                    <telerik:DockExpandCollapseCommand />
                                    <telerik:RadNumericTextBox ID="radPopSplitDuration" runat="server" Width="80">
                        <telerik:RadSchedulerRecurrenceEditor runat="server" ID="appointmentRecurrenceEditor" />

    ScriptManager in my master page
    <telerik:RadScriptManager runat="server" ID="ScriptManager" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />

    When I double click, A script error comes as 'Component 'SharedCalendar' was not found' . 

    If I were to  remove the recurrence editor from the ajax manager in the aspx page and the ajax settings in the c# code, It will not give any error. It will update other controls such as 'radPopSplitDuration' but not the recurrence editor.

    Any help would be gladly appreciated.
  2. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010

    Posted 07 Jan 2013 Link to this post

    As far as I know - there is a issue in SharePoint when tje AjaxManager is declared in markup.
    You can try to add it and define the ajax settings programmatically:
  3. Hemika
    Hemika avatar
    38 posts
    Member since:
    Dec 2012

    Posted 15 Jan 2013 Link to this post

    Thank you for the reply Cat Cheshire. I was not able to try out what you said, But I did found a solution to the problem. I added a 'RadCalendar' to the page with ID as 'sharedCalendar'. And in the my 'RadSchedulerRecurrenceEditor', I added an attribute as  'SharedCalendarID' and equaled it to the ID of my RadCalendar. Since I did that, I added the Ajax Settings in the page and also in my code as below...

    <telerik:AjaxSetting AjaxControlID="sharedCalendar">
            <telerik:AjaxUpdatedControl ControlID="sharedCalendar" />

    this.RadAjaxManager1.AjaxSettings.AddAjaxSetting(this.RadScheduler1, this.sharedCalendar);

    Then everything worked like a charm.
Back to Top