Hello!
I'm working with the treeview and I've seen that I can get the selected node, but when I try to look for it on TreeView I can't find it because TreeView.Nodes only has rootNode. What's happening?
I'm doing this on the same method:
- First I get SelectedNode and
- then I try to get its index using TreeView.Nodes.IndexOf(selectedNode), but Nodes only has rootNode.
This is the defenition of treeview on aspx page:
<asp:TreeView ID="DestinationTree" runat="server" CssClass="destinationsTree" ExpandDepth="1"
onselectednodechanged="DestinationTree_SelectedNodeChanged"
ontreenodeexpanded="DestinationTree_TreeNodeExpanded" ShowLines="True"
Font-Names=""Segoe UI",Frutiger,Tahoma,Helvetica,"Helvetica Neue",Arial,sans-serif">
<ParentNodeStyle Font-Bold="False" />
<HoverNodeStyle Font-Underline="True" ForeColor="#5555DD" />
<SelectedNodeStyle Font-Underline="True" ForeColor="#5555DD" HorizontalPadding="0px" VerticalPadding="0px" />
<Nodes>
TreeView is inside an Ajax UpdatePanel. I use TreeNodeExpand to add more nodes, and SelectedNodeChange to enable and disable buttons.
Any adviced?