Postback RadWindow and refresh ajax panels in parent page. How to???

5 posts, 0 answers
  1. Giulio
    Giulio avatar
    6 posts
    Member since:
    Jan 2008

    Posted 15 Aug 2009 Link to this post

    Hi all, I've red many thread about similar problems but I'm still quite confused...

    I have a page with 2 ajax panels in a master-detail classic configuration. In the left one I have a RagGrid with the list of my users. When I click on a row, in the other ajax panel (on the right) I show the detail information of the clicked RadGrid row.

    Now, I have 2 buttons in this page:
    1. a button that opens a "Add new user" RadWindow to add a new user
    2. another button inside the detail ajax panel and opens another RadWindow to add/modify detail information about the specific clicked row

    What I need is:
    1. when I click on the first button to insert a new user I would, on finish, close RadWindow and refresh both ajax panel in parent page to show the added user in the RadGrid
    2. when I click on the second button to add/modify detail information about a clicked row, on finish, I would refresh only the right side ajax panel with the detail informations of clicked row

    How can I managed this scenarious?
    Which are the fondametal elements I need in both parent page and RadWindow page to get it works fine?

    Thanks very much!

    Giulio Ferri
  2. Georgi Tunev
    Georgi Tunev avatar
    7207 posts

    Posted 17 Aug 2009 Link to this post

    Hi Giulio,

    I would suggest to examine the following demo:
    And the documentation article about RadAjaxPanel:

    In the demo you could see how to call a JavaScript function on the parent page from within the content page in RadWindow. The documentation article shows how to use RadAjaxpanel and its ajaxRequest() client side function in order to update the content of the panel.

    I hope this helps.

    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Hunter
    Hunter avatar
    11 posts
    Member since:
    Feb 2012

    Posted 20 Jun 2012 Link to this post

    I needed the same functionality. I modified my pages based on the demo and it worked.

    However, the demo passes the EmployeeID in the query string. I was hoping to set a session variable instead, to avoid issues with users typing in EmployeeIDs that they're not supposed to see. I'd also like to check the session to make sure the user is still logged in, and if not, to redirect to the login page instead of opening the edit form.

    Originally my edit column was a GridButtonColumn that opened the edit form through RadGrid1_ItemCommand. Since it was on the server side, I had no problem accessing session variables.

    When I started adding the ajax functionality, my edit column broke - it wasn't opening the edit form anymore. I changed the edit column to a GridTemplateColumn with a HyperLink as per the demo, and it worked. But now, can I modify the ShowEditForm() JavaScript function to assign the id to a session variable, and to check another session variable to see if the user is still logged in?
  4. Marin Bratanov
    Marin Bratanov avatar
    5811 posts

    Posted 22 Jun 2012 Link to this post


    The Session object is available only on the server and you cannot access it on the client (i.e. via JavaScript). If you need the server functionality I can suggest that you keep the grid command handler and open the RadWIndow via JavaScript (after raising your Session flags) with the approach shown in this sticky thread. An alternative I can suggest is to pass a JavaScript object to the RadWindow as is shown in this help article and this demo. You can get the needed data to build the object via the Grid's client-side rows objects as is shown in this demo by using the client row selection (or you can pass the item index as a parameter to the client-side handler as this demo shows). 

    Kind regards,
    Marin Bratanov
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  5. Hunter
    Hunter avatar
    11 posts
    Member since:
    Feb 2012

    Posted 22 Jun 2012 Link to this post

    Thanks, Marin. I used the first option and it worked.
Back to Top