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

How to use RadAjaxManagerProxy

4 Answers 817 Views
Grid
This is a migrated thread and some comments may be shown as answers.
RB
Top achievements
Rank 1
RB asked on 23 Jul 2014, 07:41 PM
I have a page with 2 radgrid controls. On pages where I have only one RadGrid, I use RadAjaxManager on the grid control and it works good. But Here where I have 2 grids on same page, and using RadAjaxManager on each grid, I saw a couple of issues like sorting not working. So i read about the  RadAjaxManagerProxy. I gave it a try but failed.

On the main page I added the RadAjaxManager as follows:
    protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            RadAjaxManager manager = new RadAjaxManager();
            manager.ID = "RadAjaxManager1";
            manager.AjaxSettings.AddAjaxSetting(_BANCtrl, _UpdatePanel);
            manager.AjaxSettings.AddAjaxSetting(_DocumentCtrl, _UpdatePanel);
            this._FsMain.Controls.Add(manager);
           }
Both the _BANCtrl and _DocumentCtrl are added to an Update panel. Next in the _BANCtrl, I add the proxy as follows:
protected override void OnPreRender(EventArgs e)
 {      
     base.OnPreRender(e);
     radProxy.ID = "RadAjaxManagerProxy1";
     radProxy.AjaxSettings.AddAjaxSetting(this._AssignBanGrid, _Panel);
 }
I have a similar thing on _DocumentCtrl also. But it doesnt work. When I sort, i get an error as follows:
Uncaught TypeError: Cannot set property 'control' of undefined. I am sure I have not set the RadAjaxManagerProxy and RadAjaxManager correctly.

4 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 28 Jul 2014, 09:13 AM
Hello,

I am not quite sure that I understand your exact requirement and what you are trying to achieve. Please note that you should have only on RadAjaxManager on a page and that RadAjaxManagerProxy is used only when you have a complex scenario with UserControls or Master/Content page scenario. Detailed information on this is available at the following help article:
You could have a look at our online demo "AjaxManager - User Controls - Master pages", where a complex scenario with RadAjaxManager and RadAjaxManagerProxy is demonstrated.

If you need any further assistance, please elaborate on your exact scenario, so I could provide more relevant to your exact project suggestions.


Regards,
Konstantin Dikov
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
RB
Top achievements
Rank 1
answered on 30 Jul 2014, 08:20 PM
I want to add RadAjaxManagerProxy programmatically. I cant find examples on this. I have 2 radgrids on 1 page which need to be ajaxified. Since I cant use RadAjaxManager in both the grids, I want to add RadAjaxManagerProxy  on main page but programmatically.
0
RB
Top achievements
Rank 1
answered on 30 Jul 2014, 08:31 PM
I want to add RadAjaxManagerProxy programmatically. I cant find examples on this. I have 2 radgrids on 1 page which need to be ajaxified. Since I cant use RadAjaxManager in both the grids, I want to add RadAjaxManagerProxy.
On the main page I added the RadAjaxManager as follows:
RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page);
ajaxManager.AjaxSettings.AddAjaxSetting(RadGridCtrl1, panel, this._ajaxLoadingPanel);
ajaxManager.AjaxSettings.AddAjaxSetting(RadGridCtrl2, panel, this._ajaxLoadingPanel);

Now in RadGridCtrl1 and RadGridCtrl2, I need to add the RadAjaxManagerProxy. PLease let me know hot to do it programmatically. 

0
Konstantin Dikov
Telerik team
answered on 01 Aug 2014, 07:17 AM
Hello,

Could you please elaborate what you mean by "Since I cant use RadAjaxManager in both the grids"? Please note that you could add as many AJAX settings to RadAjaxManager as you want. However, if by both grids you mean two different UserControls with RadGrids in them and if you want to enable AJAX for those grids programmatically, there is no point of using RadAjaxManagerProxy, because the idea of RadAjaxManagerProxy is to be used in the markup. With programmatically created settings you should get reference to the RadAjaxManager in the master page.

Please refer to the help article that I have mentioned in my previous post and Example 3 and the final note in particular:
Hope this helps.


Regards,
Konstantin Dikov
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
Grid
Asked by
RB
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
RB
Top achievements
Rank 1
Share this question
or