Cannot get Radscheduler to work with Ajax in SharePoint 2010 WebPart

3 posts, 0 answers
  1. Content and Code
    Content and Code avatar
    26 posts
    Member since:
    Oct 2004

    Posted 24 Feb 2012 Link to this post

    Hi,

    I am unable to get the radscheduler to work with ajax in sharepoint.

    For example when i click on the navigation arrows in the header it does the normal ajax partial postback but then none of the buttons work, the navigation arrow doesnt do anything, double clicking on the appointment does nothing.
  2. Content and Code
    Content and Code avatar
    26 posts
    Member since:
    Oct 2004

    Posted 24 Feb 2012 Link to this post

    Can someone please help with this. Below is the markup:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Panel1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RsScheduling" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel runat="Server" ID="RadAjaxLoadingPanel1" />
    <asp:Panel runat="server" ID="Panel1" CssClass="exampleContainer">
        <telerik:RadScheduler runat="server" ID="RsIMSScheduling" SelectedView="TimelineView"
            ShowNavigationPane="true" Width="100%" Height="70px" OverflowBehavior="Expand"
            OnNavigationComplete="RsScheduling_NavigationComplete" StartEditingInAdvancedForm="false"
            DayView-UserSelectable="false" WeekView-UserSelectable="false" MonthView-UserSelectable="false"
            AllowInsert="false" OnClientAppointmentEditing="OpenEditSchedulePopup" OnClientRecurrenceActionDialogShowing="OnClientRecurrenceActionDialogShowing">
            <TimelineView NumberOfSlots="5" SlotDuration="01:0:00" ColumnHeaderDateFormat="HH:mm"
                TimeLabelSpan="1" UserSelectable="false" />
            <AdvancedForm Modal="true" />
            <ResourceHeaderTemplate>
                Mon</ResourceHeaderTemplate>
        </telerik:RadScheduler>
    </asp:Panel>

    Outside of the panel all the buttons work, inside it the buttons on the scheduling controls do not work after the first postback.

    Same thing works outside of sharepoint.

    Also when i wrap the scheduler in an asp.net updatepanel it works as expected.
  3. Kalina
    Admin
    Kalina avatar
    918 posts

    Posted 29 Feb 2012 Link to this post

    Hello,

    I tried to reproduce the issue using the code pasted here - but without success.
    On my side RadScheduler arrows navigate properly under SharePoint 2010.

    I am suggesting you remove the Panel and the AjaxSettings dynamically for example like this:
    public class VisualWebPart1 : WebPart
    {
        // Visual Studio might automatically update this path when you change the Visual Web Part project item.
        private const string _ascxPath = @"~/_CONTROLTEMPLATES/SchedulerWebPartProject/SchedulerWebPart/VisualWebPart1UserControl.ascx";
     
        protected override void CreateChildControls()
        {
        }
             
        RadAjaxManager ajaxmgr;
        protected override void OnInit(EventArgs e)
        {
     
            base.OnInit(e);
     
            ajaxmgr = new RadAjaxManager();
            Page.Items.Add(typeof(RadAjaxManager), ajaxmgr);
            Page.Form.Controls.AddAt(0, ajaxmgr);
     
        }
     
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
     
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
     
            RadScheduler scheduler = control.FindControl("RadScheduler1") as RadScheduler;
            ajaxmgr.AjaxSettings.AddAjaxSetting(scheduler, scheduler);
        }
    }

    Regards,
    Kalina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top