How to trigger an Ajax postback on parentpage after closing radwindow

4 posts, 1 answers
  1. EmpowerIT
    EmpowerIT avatar
    117 posts
    Member since:
    Jun 2007

    Posted 19 Feb 2008 Link to this post

    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,
  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 20 Feb 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. KevinMc
    KevinMc avatar
    47 posts
    Member since:
    Dec 2006

    Posted 26 Feb 2008 Link to this post

    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.
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 27 Feb 2008 Link to this post

    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
Back to Top