Problem: I have a RadGrid that upon updating, deleting, and inserting needs to update a RadChart on the page. I have tried the RadAjaxManager codeblock below (fig. 1) but they seem to update all at the same time and the new changes do not appear until the next ajax action. The chart is in a control which is on a RadAjaxPanel (RadAjaxPanel1).
I have also tried to create a trigger in the codebehind (fig. 2) but I get errors. I’m not sure if this is even possible being that I am using the built in buttons in the radgrid that do not have IDs.
Finally, I tried setting ClientEvents-OnResponseEnd="updatechart" to try to update the chart after insert insert which seemed to be the most promising being that I could see the alert get fired at the end of the radgrid update which I put in to test it but I kept getting null errors. That java script code is below also (fig. 3).
I have spent hours on the telerik website trying to find a solution that works on this problem. Any help would be greatly appreciated.
------------------------------------------------------
(Fig. 1)
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
UpdatePanelsRenderMode="Inline">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
------------------------------------------------------
(Fig. 2)
protected void RadAjaxPanel1_AjaxSettingCreating(object sender, AjaxSettingCreatingEventArgs e)
{
AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
trigger.ControlID = Button1.ID; //<--not sure what this is suppose to be
e.UpdatePanel.Triggers.Add(trigger);
}
------------------------------------------------------
(Fig. 3)
function updatechart() {
//shot alert after steps updated!
//alert("alert");
$find("<%=RadAjaxManager1.ClientID%>").ajaxRequest('Node_Clicked');
//var ajaxMgr = $find("<%=RadAjaxManager.GetCurrent(Page).ClientID %>");
//ajaxMgr.ajaxRequest("ToDoRefreshAjax");
}