Monday, March 26, 2012

Treeview inside updatepanel postingback on selectednodechanged

Hi,

I'm having problem with a treeview inside an updatepanel on my page. The treeview is populated from the client on the treenode pouplate event. The selection of a node in the treeview triggers the content of another updatepanel to be displayed according to the selected node. Everything works fine exept that the whole tree is postedback on the selectednodechanged event even tough the triggers for that update panel is on treenodepopulate.

Here's the code :

<%-- The treeview --%> <atlas:UpdatePanel ID="uptv" runat="server" mode="conditional" 
<ContentTemplate
<asp:Panel ID="panTree" runat="server" Height="600px" ScrollBars="Auto" Style="z-index: 102;
left: 3px; position:absolute; top:5px;" Width="450px" CssClass="bordures"
<asp:TreeView ID="tvEquipement" runat="server" Height="100%" Style="z-index: 100; left: 0px;
position: absolute; top: 0px" Width="100%" ForeColor="ControlText" ExpandDepth="2" NodeIndent="10"
<SelectedNodeStyle BackColor="#D09200" Font-Bold="True" ForeColor="HighlightText" BorderColor="HighlightText" />
<RootNodeStyle Font-Bold="True" /
</asp:TreeView
</asp:Panel
</ContentTemplate
<Triggers
<atlas:ControlEventTrigger ControlID="tvEquipement" EventName="TreeNodePopulate" /
</Triggers
</atlas:UpdatePanel
<atlas:UpdatePanel ID="upInfos" runat="server" mode="conditional"
<ContentTemplate>
<%-- stuff based on the selected node--%> </ContentTemplate
<Triggers
<asp:ControlEventTrigger ControlID="tvEquipement" EventName="SelectedNodeChanged" /
</Triggers
</atlas:UpdatePanel>

Any hep or idea would be greatly appreciated.

Thanks,

Max

The treeview is inside the update panel and childrenAsTriggers is set to true (Default is true). Therefore, if you click on control inside the update panel it would result in the
update panel getting updated. What you have to do is set ChildrenAsTriggers = false for the update panel with treeview.

On a different note: Treeview inside an update panel is not a supported scenario.

vineetc


Thanks for your reply. I don't seem to have that property. Is this a new feature from the Ajax Beta release. I'm still working with the last Atlas release.

The tree wasn't in an updatepanel at first, but I had to put it in one because the selectedvalue property was messed up when outside the updatepanel.

Max


Ajax beta release has this property. Also Property "Mode" of the update panel is renamed to "UpdateMode".

vineetc


No comments:

Post a Comment