I have read a lot of posts about selectednode, but I couldnt find my problem or solution. I by any chance I missed it, I apologize.
My problem:
I am using a treeview that is populated dynamically by using the PopulateOnDemand property. When the page is loaded, the first level of child nodes is loaded. Those childnodes become bold when selected and the navigation to the given target and url works fine. The node becomes bold because of the selectednode-style-fontbold property set on the control. So far so good.
When expanding a node on the first level the childnodes are populated as expected and the target and url properties are working correctly. However when selecting one of those childnodes, the node does not become bold and cannot be retrieved by selectednode. The parentnode that was bold remains bold.
a piece of code:
public void PopulateNode(Object source, TreeNodeEventArgs e)
{
foreach (item x in list)
{
TreeNode newNode = new TreeNode(name, value, imgurl);
newNode.Target =
"CenterPanel"; //this is the iframenewNode.NavigateUrl ="myPage.aspx?id=" + name;
newNode.PopulateOnDemand =
true; //I know this node has childrennewNode.SelectAction = TreeNodeSelectAction.Select;
node.ChildNodes.Add(newNode);
}
The above works for the first level but not for the next levels. I got it to work only in one way: By setting the ExpandDepth to e.g. 20. In that case the whole tree gets populated and then all the nodes can be selected and show the nodeselectedstyle.
What am I missing.
Kind regards, Momoski