How to rebind more three RadGrid after close the RadWindow

2 posts, 0 answers
  1. Manish
    Manish avatar
    65 posts
    Member since:
    Jul 2011

    Posted 01 Nov 2013 Link to this post


    I am getting problem in rebind radgrid on radwindow close because i have to rebind 3 grid on parent page. It is rebinding just last grid which i have mentioned in code.
    Following code i have used in my code

    ///------ In radwindow javascript code -------
     function clientClose(arg) {
                    var oWin = getRadWindow();
                    var parentWindow = oWin.BrowserWindow;
                    // top.location.href = top.location.href;

    /// ---------In parent page javascirpt code -----
            function refreshGrid() {
                    var masterTable1 = $find("<%=rgDefinition.ClientID%>").get_masterTableView();
                    var masterTable2 = $find("<%=rgDevelopment.ClientID%>").get_masterTableView();
                      var masterTable3 = $find("<%=rgTesting.ClientID%>").get_masterTableView();
    Problem is that ----   this code rebinding my last grid means masterTable3.rebind(); because it is in the last of code.
  2. Konstantin Dikov
    Konstantin Dikov avatar
    2087 posts

    Posted 04 Nov 2013 Link to this post

    Hello Manish,

    The functionality you want could not be achieved entirely on client-side. 

    One possible solution for your requirement could be to fire a custom command through one of the grids and in the code-behind to rebind the three grids.

    Here is how you could fire command from a grid:
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
        <script type="text/javascript">
            function rebindGrids(sender, args) {
                var grid = $find("<%=RadGrid1.ClientID%>");
                grid.get_masterTableView().fireCommand("rebindGrids", "");
    <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" OnClientClose="rebindGrids"></telerik:RadWindow>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
        <telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand"></telerik:RadGrid>
        <telerik:RadGrid ID="RadGrid2" runat="server" OnNeedDataSource="RadGrid2_NeedDataSource"></telerik:RadGrid>
        <telerik:RadGrid ID="RadGrid3" runat="server" OnNeedDataSource="RadGrid3_NeedDataSource"></telerik:RadGrid>

    And the code-behind for handling the custom command:
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        if (e.CommandName == "rebindGrids")

    Attached you could find a sample page with the above functionality.

    Hope that helps.


    Konstantin Dikov
    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 the blog feed now.
Back to Top