Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Grid > Refresh Grid using ajax on parent window

Not answered Refresh Grid using ajax on parent window

Feed from this thread
  • david Intermediate avatar

    Posted on Feb 9, 2012 (permalink)

    I'm trying to have a radwindow force a refresh of a grid on the parent (named "grdLectures")
    I have this on the parent window which i can see does run when called from the radwindow :
              function refreshGrid(arg) {
                       if (!arg) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                    }
                    else {      
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
                    }
    
    
    my RadAjaxManager is like this:

        <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" 
                        OnAjaxRequest="RadAjaxManager1_AjaxRequest"  
    DefaultLoadingPanelID
    ="RadAjaxLoadingPanel1">         <AjaxSettings>           <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">                     <UpdatedControls>                         <telerik:AjaxUpdatedControl ControlID="grdLectures" />                     </UpdatedControls>                 </telerik:AjaxSetting>             <telerik:AjaxSetting AjaxControlID="grdAssets">                 <UpdatedControls>                     <telerik:AjaxUpdatedControl ControlID="grdAssets" />                     <telerik:AjaxUpdatedControl ControlID="grdLectures" />                     <telerik:AjaxUpdatedControl ControlID="msg" />                 </UpdatedControls>             </telerik:AjaxSetting>             <telerik:AjaxSetting AjaxControlID="grdLectures">                 <UpdatedControls>                     <telerik:AjaxUpdatedControl ControlID="grdLectures" />                 </UpdatedControls>             </telerik:AjaxSetting>         </AjaxSettings>     </telerik:RadAjaxManager>

    and the Ajax Event handler (which does not get executed as far as I can tell)  :

        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            if (e.Argument == "Rebind")
            {
                grdLectures.MasterTableView.SortExpressions.Clear();
                grdLectures.MasterTableView.GroupByExpressions.Clear();
                grdLectures.Rebind();
            }
            else if (e.Argument == "RebindAndNavigate")
            {
                grdLectures.MasterTableView.SortExpressions.Clear();
                grdLectures.MasterTableView.GroupByExpressions.Clear();
                grdLectures.MasterTableView.CurrentPageIndex = grdLectures.MasterTableView.PageCount - 1;
                grdLectures.Rebind();
            }

    Reply

  • david Intermediate avatar

    Posted on Feb 9, 2012 (permalink)

    When I fixed it like this, I changed the js handler that's called from the rad window to be this:

                function refreshGrid(arg) {
                    $find("<%= grdLectures.ClientID %>").get_masterTableView().rebind();
                }

    Which has the same effect , can someone explain why my other solution didnt work and this did, since I'm assuming the refresh that i force here is causing the Radajaxmanager to call the same code behind anyways?

    Reply

  • Tsvetoslav Tsvetoslav admin's avatar

    Posted on Feb 10, 2012 (permalink)

    Hi David,

    Thank you for contacting us.

    If you have the refresshGrid(arg)... method in the parent window and the child windows successfully calls it, there is no reason for the ajax request to fire and the RadAjaxManager1_AjaxRequest handler to get hit on the server. Furthermore, your ajax settings are correct too. Therefore, please carefully compare your implementation to our online example on the same scenario and if the problem persists I'd ask you to paste your complete mark-up and code behind for both the parent and the child windows.

    Hope it helps.
     
    All the best,
    Tsvetoslav
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Grid > Refresh Grid using ajax on parent window
Related resources for "Refresh Grid using ajax on parent window"

ASP.NET Grid Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  |  Step-by-step Tutorial  ]