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

Updating a grid on window close with ajaxmanagerproxy and master pages

4 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
KevinMc
Top achievements
Rank 1
KevinMc asked on 16 Jul 2008, 03:35 AM
Can someone update the example below to work on a content page where the radajaxmanager is in the master and the ajaxsettings are specified in the radajamanager proxy? Calling the radajaxmanager1 in the rebind javascript does not seem to work. 

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
     <UpdatedControls> 
          <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
     </UpdatedControls> 
</telerik:AjaxSetting>   
 


http://www.telerik.com/DEMOS/ASPNET/Prometheus/Controls/Examples/Integration/GridAndWindow/DefaultCS.aspx?product=grid

4 Answers, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 16 Jul 2008, 01:48 PM
Hello KevinMc,

I need to mention that the RadAjaxManagerProxy does not provide any client-side functionality as the RadAjaxmanger does. Therefore, you cannot use it to invoke ajax requests from javascript. More information on the topic can be found here. This functionality can be achieved by getting the current ajax manager from the master/owner page instead:

function MyJavascriptFunction() 
    $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Toggle"); 

For your convenience, attached is a sample project demonstrating how RadAjaxManager can be referenced from a javascript function in a user control.

Best wishes,
Veli
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
KevinMc
Top achievements
Rank 1
answered on 17 Jul 2008, 05:05 PM
I looked at the example but can't see how it helps in my situation, which i would think would be a common situation.

I have a masterpage with a radajaxmanager on it
I have a content page with a radgrid and radajaxmanagerproxy on it
I have edit buttons in the radgrid which launch a telerik radwindow.

I want to rebind the radgrid when the user clicks finish in the radwindow.

I have done this fine until now with the radajaxmanager directly in the content page. But we added some ajax elements to the master page so i had to move ajamanager there and start using proxy on all my content pages. So the past way of doing it using:  http://www.telerik.com/DEMOS/ASPNET/Prometheus/Controls/Examples/Integration/GridAndWindow/DefaultCS.aspx?product=grid

no longer works since i can't trigger an ajaxrequest on the proxy and i can't specify the radajaxmanager control on the master page as an ajaxsetting in the proxy.
0
Veli
Telerik team
answered on 18 Jul 2008, 10:15 AM
Hello KevinMc,

As I said, the RadAjaxManager is only one for the master, content pages an any user controls inside. Therfore, you should still be able to access it using

$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Toggle");

regardless of where you place your javascript - master, content, or user control. As these elements are all merged together to generate the page html, it should be possible to find the RadAjaxManager client object in the manner described above. Please check it out.

All the best,
Veli
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
HHalim
Top achievements
Rank 2
answered on 30 Jul 2008, 04:59 PM
Hello all,
After spending several days trying to move old radgrid+radwindow to ASP.NET ajax version with these requirements:
Radgrid is in content page.
Radgrid is editable using radwindow.
Radgrid must be refreshed/rebind with ajax.

I found the best way is not to use prometheus RadAjaxManager to refresh/rebind radgrid, but using the RadAjaxPanel to wrap the radgrid, this is similar to EnableAjax=true feature in the old version of radgrid.
Then when editing using radwindow finished, call javascript ajaxpanel.ajaxrequest to refresh the grid.
function RefreshGrid(arg) 
    if(arg) 
        $find("<%= AjaxPanel.ClientID %>").ajaxRequest(arg); 
 

The ajaxpanel OnAjaxRequest event handler is in the contentpage, so no need to get the ajaxmanager or any javascript on the masterpage location.

Adding to the complexity, I also have a search text box and button for the data on the grid, I successfully use the RadAjaxManagerProxy to rebind radgrid from the button click.

Works like a charm in masterpage+contentpage situation.

I hope this helps.
Tags
Grid
Asked by
KevinMc
Top achievements
Rank 1
Answers by
Veli
Telerik team
KevinMc
Top achievements
Rank 1
HHalim
Top achievements
Rank 2
Share this question
or