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

RadAjaxManager to update related control only on certain triggering control event

1 Answer 110 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Anar
Top achievements
Rank 1
Anar asked on 10 Dec 2011, 12:28 PM
Hello,

I have a radgrid on my form and several text and combo boxes.
My intent is to update related boxes as soon as radgrid selection changes.
For that I use RadAjaxManager and set relations like
<telerik:AjaxSetting AjaxControlID="rgMain">
           <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="rtbEmployeeName" />
               <telerik:AjaxUpdatedControl ControlID="cbEmployeeActive" />
               <telerik:AjaxUpdatedControl ControlID="rtbHomePhone" />
               <telerik:AjaxUpdatedControl ControlID="rtbMobilePhone" />
               <telerik:AjaxUpdatedControl ControlID="rcbPosition" />
           </UpdatedControls>
       </telerik:AjaxSetting>

After that I process SelectedIndexChanged event in code-behind and get updated controls on client side - everything is OK.

However, when I use paging or sorting built-in into Radgrid it again triggers the update of the controls. I only would like them to update on selection change, not on page change or sort.
Is there a way to filter which events of a master control should trigger ajax updates of related controls ?

Thanks for your attention.

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 12 Dec 2011, 03:40 PM
Hi Anar,

One possible approach in this case is toe use partial Ajaxification as shown in the following online demo.

Another approach is to use asp UpdatePanel and set EventName for specific AsyncPostBackTrigger. For example:
<asp:UpdatePanel ID="UpdatePanel1" runat="server"
    <ContentTemplate>
        <asp:Panel ID="Panel1" runat="server"
//Controls you need to update here
        </asp:Panel>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="RadGrid1" EventName="SelectedIndexChanged" />
    </Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server"
    <ContentTemplate>
        <telerik:RadGrid ID="RadGrid1" runat="server"
        </telerik:RadGrid>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="RadGrid1" EventName="PageIndexChanged" />
    </Triggers>
</asp:UpdatePanel>

I hope this helps.

All the best,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Ajax
Asked by
Anar
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or