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

Update RecurenceEditor using AJAX

2 Answers 80 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Hemika
Top achievements
Rank 1
Hemika asked on 01 Jan 2013, 05:41 PM
Hello, 
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)
        {
            appointmentRecurrenceEditor.ResetLayout();
 
            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);
            PopulateEditForm(appointmentToEdit);
 
        }
 
        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">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="radPopSplitDuration">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radPopSplitDuration" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="appointmentRecurrenceEditor">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="appointmentRecurrenceEditor" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

RadDock
<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%>">
            <Commands>
                <telerik:DockExpandCollapseCommand />
            </Commands>
            <ContentTemplate>
                <div>
                                <telerik:RadNumericTextBox ID="radPopSplitDuration" runat="server" Width="80">
                                </telerik:RadNumericTextBox>
                    <telerik:RadSchedulerRecurrenceEditor runat="server" ID="appointmentRecurrenceEditor" />
                </div>
            </ContentTemplate>
        </telerik:RadDock>
    </asp:Panel>


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

Problem...
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 Answers, 1 is accepted

Sort by
0
Cat Cheshire
Top achievements
Rank 1
answered on 07 Jan 2013, 08:23 AM
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:
http://www.telerik.com/community/forums/aspnet-ajax/scheduler/preintialize-javascript-error.aspx
0
Hemika
Top achievements
Rank 1
answered on 16 Jan 2013, 03:41 AM
Hello,
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">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="sharedCalendar" />
    </UpdatedControls>
</telerik:AjaxSetting>

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

Then everything worked like a charm.
Tags
Scheduler
Asked by
Hemika
Top achievements
Rank 1
Answers by
Cat Cheshire
Top achievements
Rank 1
Hemika
Top achievements
Rank 1
Share this question
or