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

Updating user control on Master Page from Content Page with RadAjaxManager

1 Answer 132 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 04 Oct 2011, 04:01 AM
I have a master page with a custom user control. The user control has a RadTreeView within it.

<ucs:ListsTab ID="ucListsControl" runat="server" />

I've exposed a property for this control on the master page.

public TplListControlTab TplListControl {
    get {
        return ucListsControl;
    }
}

On my content page I have a RadAjaxManager and have both a RadGrid and the user control as controls to be updated. I understand that it's a better idea to have the RadAjaxManager on the master page but this won't be possible in my case.

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel2" />
        <telerik:AjaxUpdatedControl ControlID="ucListsControl" />
    </UpdatedControls>
</telerik:AjaxSetting>

I initiate a client side AJAX request as follows:

var _ajaxManager = "<%= RadAjaxManager1.ClientID %>";
$find(_ajaxManager).ajaxRequest("SomeCommand");

In my RadAjaxManager1_AjaxRequest method I handle the request:

if (e.Argument == "SomeCommand") {
    // ... do some stuff to RadGrid's datasource.
    RadGrid1.Rebind();

    // ... do some stuff to user control's datasource.
    Master.TplListControl.RadTreeView.DataBind();
}

The RadGrid correctly updates but the user control does not. I've tried setting the AjaxSettings programmatically but this doesn't work either. Is this not possible or am I doing something wrong?

1 Answer, 1 is accepted

Sort by
0
Christopher
Top achievements
Rank 1
answered on 04 Oct 2011, 07:26 AM
Ok, turns out this was my fault.

The user control has a RadTreeView as mentioned. I was baffled as to why it wasn't being updated. Turns out it was. The user control was in an overflow div and I wasn't scrolling down to see the new nodes!
Tags
Ajax
Asked by
Christopher
Top achievements
Rank 1
Answers by
Christopher
Top achievements
Rank 1
Share this question
or