I've been working on this issue all weeken and have read almost every post and demo related to the RadGrid and to the RadAjaxManager, Hopefully I've posted enough informatio to get a clear understanding of my issue
I’m using a CommandItem Templete to add a new record to a grid with a custom form. I have the “add new record” linkbutton working but I need some help with the grid refresh when the radWindow closes. I'm using the sample that opens a radWindow and then passes back informtion to the parent form with the OnClientClose . I’m also using DotNetNuke as my platform and I’ve creates a usercontrol for my module. I would like the Grid to refresh when I close the radWindow that has the form. I’m using the return to parent that is in one of the demos but I cannot get any type of grid refresh to work outside of calling a page reload. It seems that the problem is in the fact that I need to programmatically add the radAjaxManager programmatically to the page. I’ve tried using
Dim manager As New RadAjaxManager()
manager.ID = "RadAjaxManager1"
Me.Page.Form.Controls.Add(manager)
But if I try to immediately test it with
value = TryCast(Me.Page.Items(GetType(RadAjaxManager)), RadAjaxManager) I come back with nothing.
Also if I put
function refreshGrid(arg) {
if (!arg) {
var mgr = $find('<%=RadAjaxManager.GetCurrent(Page).ClientID %>');
mgr.ajaxRequest("Refresh")
return false;
}
}
I get this error:
A critical error has occurred.Object reference not set to an instance of an object.
I have added:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
The bottom line is that I cannot get the RadAjaxManager1_AjaxRequest to fire so I can run RadGrid1.MasterTableView.SortExpressions.Clear()
RadGrid1.MasterTableView.GroupByExpressions.Clear()
RadGrid1.Rebind()
I have added window.location.reload(true); to the OnClientClose function and that refreshes the grid currently but that is not the smoothest way. All help is appreciated.
Bill