Refresh 2 RadGrids on window close

3 posts, 1 answers
  1. Joseph
    Joseph avatar
    29 posts
    Member since:
    Sep 2007

    Posted 28 Jan 2012 Link to this post

    Hi Telerik Community,

    I have two RadGrids sitting on a page, both inside a RadAjaxPanel. When I have RadWindow close, my add_close function (oWnd.add_close(RefreshAfterMatch);) will only refresh one of the two grids (perDiemBookingsRadGrid). Here is my function:
    function RefreshAfterMatch() {
                var matchMasterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
                var pdMasterTable = $find("<%= perDiemBookingsRadGrid.ClientID %>").get_masterTableView();
                matchMasterTable.rebind();
                pdMasterTable.rebind();
            }

    Any ideas on how to get both grids to rebind?

    Thanks,
    Joe
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    5243 posts

    Posted 31 Jan 2012 Link to this post

    Hi Joe,

    The rebind() cilent-side command fires the server-side code to rebind the grid it is called from, so both grids will perform requests and the first will be cancelled as this is the way AJAX works.

    I can offer you several ways to go around this:

    1) increase the value of the RequestQueueSize property of the panel

    OR

    2) use the RadAjaxManager to perform an AJAX request for both grids (e.g. you could pass a parameter that will indicate in the code-behind that these two grids need to be rebound) instead of the client-side rebind() method

    OR

    3) use a regular update panel around both grids and a hidden button inside that will invoke the request to rebind the grids. This button's request can be initiated via the __doPostBack() command by passing its UniqueID as the first parameter. Again rebind() should be called from the server this time.


    Greetings,
    Marin
    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
  3. Joseph
    Joseph avatar
    29 posts
    Member since:
    Sep 2007

    Posted 31 Jan 2012 Link to this post

    Option 1 - Increasing the RequestQueueSize did the trick - Thanks!
Back to Top