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

Telerik Rad Ajax Loading Panel issue in SharePoint 2010

3 Answers 54 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Platinum
Top achievements
Rank 1
Platinum asked on 01 Jul 2014, 01:52 AM
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

3 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 03 Jul 2014, 10:51 AM
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.

 
0
Platinum
Top achievements
Rank 1
answered on 06 Jul 2014, 08:03 AM
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 ?
0
Marin
Telerik team
answered on 07 Jul 2014, 07:07 AM
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.

 
Tags
Ajax
Asked by
Platinum
Top achievements
Rank 1
Answers by
Marin
Telerik team
Platinum
Top achievements
Rank 1
Share this question
or