I have a master page set up with a RadAjaxManager, some controls, and a content placeholder. I have wired up a few buttons to a RadTreeView that exists on the master page, and ajax updates are occurring as expected. I have also used RadAjaxManagerProxy to successfully ajax-enable a grid that resides in the content page.
What I have not been able to do is configure the content page so that I can trigger an update to the treeview on the master page. Here's what I've done so far:
Below is the key piece code I've used to try to set up the scenario described above. The buttonMakeDemo control is a button which I need to update the RadGrid within the content page and the RadTreeView in the master page.
First, the relevant ajax code in my ASPX page. I'm allowing the grid to be ajax-enabled for sorting, and I'm allowing the button to update the grid:
Next, the relevant codebehind in the content page. You can see that I've also tried adding the settings to the RadAjaxManagerProxy's AjaxSettings, but that doesn't work either.
In case it matters, here's the codebehind for the button click event. "ThreePaneMaster" is the class name of the master page in question. Don't worry about the argument passed to that BuildHierarchy method -- it's a business object accessible on the page.
Any ideas what I might be doing wrong? The ajax-enabled controls work so long as they're all either in the master or in the content, but not if one's in the content and one's in the master.
Thanks,
Josh
What I have not been able to do is configure the content page so that I can trigger an update to the treeview on the master page. Here's what I've done so far:
- I have exposed a public method on the master page called BuildHierarchy() which populates the treeview.
- I have a button in the content page that calls the BuildHierarchy() method after changing some data.
- I have programmatically added the ajax settings that I thought would allow the AjaxManager to allow that update.
Below is the key piece code I've used to try to set up the scenario described above. The buttonMakeDemo control is a button which I need to update the RadGrid within the content page and the RadTreeView in the master page.
First, the relevant ajax code in my ASPX page. I'm allowing the grid to be ajax-enabled for sorting, and I'm allowing the button to update the grid:
<telerik:RadAjaxManagerProxy ID="radajaxProxy" runat="server"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="gridMGs"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="gridMGs" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
<telerik:AjaxSetting AjaxControlID="buttonMakeDemo"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="gridMGs" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManagerProxy> |
Next, the relevant codebehind in the content page. You can see that I've also tried adding the settings to the RadAjaxManagerProxy's AjaxSettings, but that doesn't work either.
var ajaxManager = RadAjaxManager.GetCurrent(Page); |
var treeviewHierarchy = (RadTreeView) Master.FindControl("treeviewHierarchy"); |
// radajaxProxy.AjaxSettings.AddAjaxSetting(buttonMakeDemo, treeviewHierarchy); |
ajaxManager.AjaxSettings.AddAjaxSetting(buttonMakeDemo, treeviewHierarchy); |
In case it matters, here's the codebehind for the button click event. "ThreePaneMaster" is the class name of the master page in question. Don't worry about the argument passed to that BuildHierarchy method -- it's a business object accessible on the page.
protected void buttonMakeDemo_Click(object sender, EventArgs e) |
{ |
// Do my business logic stuff here |
gridMGs.Rebind(); |
((ThreePaneMaster) Master).BuildHierarchy(RootSecurityToken.AccountID); |
} |
Any ideas what I might be doing wrong? The ajax-enabled controls work so long as they're all either in the master or in the content, but not if one's in the content and one's in the master.
Thanks,
Josh