Telerik Rad Ajax Loading Panel issue in SharePoint 2010

4 posts, 0 answers
  1. Platinum
    Platinum avatar
    31 posts
    Member since:
    Jan 2008

    Posted 30 Jun 2014 Link to this post

    Hi

    I am using this online demo http://demos.telerik.com/aspnet-ajax/treeview/examples/functionality/draganddropnodes/defaultcs.aspx  codes to be used in SharePoint 2010. I am using drag and drop of nodes from Tree view to Grid.  For the first Drag and Drop, the Ajax loading panel will not work. in the sense ajax will not be intiated the whole page gets refreshed. Whereas for the second drag and drop the ajax loading panel will work fine without any issue,
    May i know where i am going wrong. Please advise
  2. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 03 Jul 2014 Link to this post

    Hello,

    The ajax in sharepoint in configured differently. We recommend using only RadAjaxMananger in case of sharepoint web parts and adding the ajax setting programmatically in the CreateChildControls method of the web part. Here is a short example:
    protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
     
                SetUpAjaxManagerOnPage();
     
                EnsureChildControls();
            }
     
            // Visual Studio might automatically update this path when you change the Visual Web Part project item.
            private const string _ascxPath = @"~/_CONTROLTEMPLATES/AjaxVisualWebPart/AjaxVisualWebPart/AjaxVisualWebPartUserControl.ascx";
     
            protected override void CreateChildControls()
            {
                Control control = Page.LoadControl(_ascxPath);
     
                RadGrid grid = control.FindControl("RadGrid1") as RadGrid;
                RadAjaxLoadingPanel loadingPanel = control.FindControl("RadAjaxLoadingPanel1") as RadAjaxLoadingPanel;
     
                if (grid != null)
                {
                    AjaxSetting ajaxSetting = new AjaxSetting();              
                     
                    ajaxSetting.AjaxControlID = grid.ID;
                    ajaxSetting.UpdatedControls.Add(new AjaxUpdatedControl(grid.ID, loadingPanel.ID));
     
                    AjaxManager.AjaxSettings.Add(ajaxSetting);
                     
                }
     
                Controls.Add(control);
            }
     
            protected void SetUpAjaxManagerOnPage()
            {
                RadAjaxManager currentAjaxManager = RadAjaxManager.GetCurrent(Page);
     
                if (currentAjaxManager == null)
                {
                    Page.Form.Controls.AddAt(0, AjaxManager);
                    Page.Items.Add(typeof(RadAjaxManager), AjaxManager);
                }
            }
     
            private RadAjaxManager _ajaxManager;
            protected virtual RadAjaxManager AjaxManager
            {
                get
                {
                    if (_ajaxManager == null)
                    {
                        _ajaxManager = RadAjaxManager.GetCurrent(Page);
     
                        if (_ajaxManager == null)
                        {
                            _ajaxManager = new RadAjaxManager() { ID = "RadAjaxManager1" };
                        }
                    }
     
                    return _ajaxManager;
                }
            }


    Regards,
    Marin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Platinum
    Platinum avatar
    31 posts
    Member since:
    Jan 2008

    Posted 06 Jul 2014 in reply to Marin Link to this post

    Hi, the ajax is working, but i have lost the loading panel. When i drag and drop the default loading panel with loading images does not comes out. How to solve that ?
  5. Marin
    Admin
    Marin avatar
    1045 posts

    Posted 07 Jul 2014 Link to this post

    Hello,

    You should set the Skin property of the loading panel.
    RadAjaxLoadingPanel loadingPanel = control.FindControl("RadAjaxLoadingPanel1") as RadAjaxLoadingPanel;
    loadingPanel.Skin = "Default";



    Regards,
    Marin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top