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

How to trigger an Ajax postback on parentpage after closing radwindow

3 Answers 390 Views
Window
This is a migrated thread and some comments may be shown as answers.
EmpowerIT
Top achievements
Rank 2
EmpowerIT asked on 19 Feb 2008, 11:24 PM
Hi,
I want to know if it is possible to trigger an ajax postback on the parent page of a radwindow after you close the radwindow?

i.e. I have a parent page that displays a grid of some sort. Clicking on something opens a radwindow, in which you can edit some details. After saving and closing the radwindow, i need the grid to refresh using ajax

I currently do a whole page refresh (based on the documentation examples). Is it possible not to do a whole page refresh and only trigger an ajax update for the grid?

Thanks,

3 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 20 Feb 2008, 08:23 AM
Hi EmpowerIT,

Yes, such scenario is possible. What you need to do is to hook to the close event of the RadWindow by using the OnClientClose property and to invoke your ajax call in the corresponding Javascript function

e.g.
function OnClientClose(sender,args) 
 //your code here 
 
</script> 
 
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"
    <Windows> 
        <telerik:RadWindow  
            ID="RadWindow1"  
            OnClientClose="OnClientClose"  
            runat="server"  
            NavigateUrl="DialogA1.aspx"
        </telerik:RadWindow> 
    </Windows> 
</telerik:RadWindowManager> 



Regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
KevinMc
Top achievements
Rank 1
answered on 26 Feb 2008, 06:33 PM
Could you provide an example of rebinding a grid from the OnClientClose event? So if a user edits items in the radwindow when they close the window we want the grid to rebind so the updated values get displayed.
0
Georgi Tunev
Telerik team
answered on 27 Feb 2008, 03:11 PM
Hello KevinMc,

The RadGrid control itself does not have a client-side function that rebinds the grid on the server. As noted in my previous reply, you need to use the RadAjax's client-side API to initiate Ajax request that would rebind your grid on the server. For example you can check the followin demo which shows the same approach but with the ASP.NET versions of our controls:
http://www.telerik.com/demos/aspnet/Controls/Examples/Integration/GridAndWindow/DefaultCS.aspx?product=grid

Since you are using the Prometheus versions however, you need to change the client code accordingly to the Client-Side API of the Prometheus RadAjax:

<%=AjaxManager1.ClientID%>.AjaxRequest(arguments)

where arguments are the parameters, which the control had used when it raised the request .



Kind regards,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Window
Asked by
EmpowerIT
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
KevinMc
Top achievements
Rank 1
Share this question
or