refresh grid on window close

5 posts, 0 answers
  1. Anumeha
    Anumeha avatar
    36 posts
    Member since:
    Aug 2010

    Posted 08 Oct 2010 Link to this post

    I have a grid with a nested grid and some buttons in the nestedItemTemplate.
    The button opens up a radgrid modal window, The user can make some changes on that page and save them to database.
    When the user closes the window I want my nested grid to refresh so that it can pull the updates made to the database without refreshing the page.

    Could you help?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Oct 2010 Link to this post

    Hello,


    Try the following approach to accomplish this:

    Attach the OnClientClose to RadWindow and invoke an ajaxRequest in the event handler. Now in the AjaxManager_AjaxRequest event rebind the grid from code.
    Check this out for ore information: Client-Side API


    Also check the demo: Window Editing


    -Shinu.
  3. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 11 Oct 2010 Link to this post

    Hello guys,

    I see that Shinu has already answered (thanks, Shinu) and I just wanted to add some more information. If you examine the code of the content page in the demo, you will notice that we actually call a JavaScript function on the parent page that does the AjaxRequest. This is helpful in cases where you would want, for example, to keep the RadWindow open. If you close the RadWindow every time after the record is updated, you can simply call this function in the OnClientClose event handler of the window.

    Sincerely yours,
    Georgi Tunev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  4. Anumeha
    Anumeha avatar
    36 posts
    Member since:
    Aug 2010

    Posted 11 Oct 2010 Link to this post

    Hi Georgi,

    I was able to attach the onclientclose event but I am having some issues.

    The handler for the ajaxrequest is on the master page. How do i get access to the nested grid through the master page?
    The examples you listed were not a master-content scenario so I am still having troubles refreshing the grid on closing the window.

    I do not want to refresh the entire grid (the main grid) as there's a lot of code attached to that. I am hiding some controls and showing some based on certain action of the user before he can see the inner nested grid and perform some action. Is it possible to just refresh my nested grid without refreshing the entire grid.
  5. Anumeha
    Anumeha avatar
    36 posts
    Member since:
    Aug 2010

    Posted 11 Oct 2010 Link to this post

    An update to my earlier thread:

    I was able to get the ajaxrequest in my current page using the help from some of the forum threads:
    http://www.sitefinity.com/devnet/forums/aspnet-ajax/grid/radajaxmanager-on-masterpage-and-refreshing-radgrid-on-a-user-conrol-using-it.aspx

    The grid is refreshing now. Thanks for the help.
Back to Top