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 ?