AjaxRequest not firing

4 posts, 0 answers
  1. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 31 Oct 2008 Link to this post

    Im using a RadWindow as an edit form for an ajax grid.
    AjaxRequest isnt being fired when I insert data, which means the grid isnt updating on the parent form

    In the Radwindow I have a button that calls the data insert function and closes the window

     InsertBandMember();  
                ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "CloseAndRebind('navigateToInserted');", true); 

    this calls the javascript function in the RadWindow edit form

    function CloseAndRebind(args) {  
                    GetRadWindow().Close();  
                    GetRadWindow().BrowserWindow.refreshGrid(args);  
                } 

    this then calls the javascript function in the parent form (where the grid lives)

    function refreshGrid(arg) {  
                debugger;  
                if (!arg) {  
                    $find("<%= Telerik.Web.UI.RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Rebind");  
     
                }  
                else {  
                    $find("<%= Telerik.Web.UI.RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigate");  
     
                }  
            } 

    and finally heres the Ajax Request event handler in the code behind

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

    This never gets called, but in the javascript, this line does

    $find("<%= Telerik.Web.UI.RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("RebindAndNavigate");   

    Im using an ajax manager on a master page, so ive put an ajaxproxymanager on the grid page
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
                            <UpdatedControls> 
                                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                            </UpdatedControls> 
                        </telerik:AjaxSetting>   
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1"   
                            LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManagerProxy> 

    Yet still the grid wont update.  The data is being committed to the database, so how can I get the grid to do an ajax refresh ?
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 03 Nov 2008 Link to this post

    Hi Mark,

    I examined your code and it seems to be correct. Since I do not have your full source code I am not able to find the problem. However, this online demo is very similar to your scenario and I suggest to examine its full source code and ompare it to yours.

    When you install RadControls, our online examples projects are automatically installed on your computer and you can not only examine their full source code, but also extend them further in order to meet your requirements.

    You can open the demos from here:

    Start\Programs\Telerik\RadControls for ASPNET AJAX\Open Sample WebSite In VisualStudio

    The actual location on your hard disk is the following one:

    C:\Program Files\Telerik\RadControls for ASPNET AJAX \Live Demos

    If this does not help, please prepare a sample, fully runnable demo (including DB, if needed, e.g Northwind), open a new support ticket and send it to me along with detailed reproduction instructions.


    Best wishes,

    Svetlina
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. mww
    mww avatar
    257 posts
    Member since:
    Sep 2012

    Posted 04 Nov 2008 Link to this post

    That was actually the example I based mine on, its practically identical, but mine wont update the grid after an insert
  5. kyle goodfriend
    kyle goodfriend avatar
    53 posts
    Member since:
    Mar 2007

    Posted 25 Jan 2009 Link to this post

    Mark, have you resolved this?  I didn't start with the example, but am doing something similar.  My window allows the user to upload images, which is saved in a database.  My grid isn't refreshing either.  I verified that the JS is firing the ajaxRequest.  I see the processing panel image for a split second, but the records aren't updated in the grid.  I figure there one thing I am missing that connects the processes and was hoping your problem would fix mine!
Back to Top