This is a migrated thread and some comments may be shown as answers.

Ajax item in order to allow Radgrid Items to be inserted first.

1 Answer 46 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 2
Jason asked on 30 Dec 2009, 02:40 PM

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");

                    }

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 04 Jan 2010, 11:27 AM
Hi Adisa,

Please check out this help topic on how to ajaxify control wrapped in RadAjaxPanel with RadAjaxManager. In this case, I assume you do not need to handle neither the AjaxSettingCreating server-side nor the OnResponseEnd client-side event. However, you might still need to re-bind the chart on RadGrid UpdateCommand/InsertCommand/DeleteCommand or ItemCommand server-side event.

Let me know if this helps.

Kind regards,
Iana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Ajax
Asked by
Jason
Top achievements
Rank 2
Answers by
Iana Tsolova
Telerik team
Share this question
or