Home - Forums-.NET - FlyTreeView (ASP.NET) - Access TreeNode by Key

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

Access TreeNode by Key
Link Posted: 05-Oct-2005 01:27
I want to access a TreeNode using the Key of the node like this:

MyTree.Nodes("Key")

Since it looks like that this is not possible, do you have any other ideas
how to do it ?

Thank?s

Thomas
Link Posted: 06-Oct-2005 20:22
You should use
MyTree.FindNode(new string[] {"Key"})
method
the parameter of this method is a string array of keys (a path to the node).
Link Posted: 06-Oct-2005 21:01
But I don?t have the path I only have the key of that particular node...
Link Posted: 10-Oct-2005 05:03
Could you tell more on the way you choose to fill the TreeView ? (static, xml, DataSet, .aspx...)
Link Posted: 10-Oct-2005 20:47
[quote="tleclaire"]But I don?t have the path I only have the key of that particular node...

The key of node is a value unique between its sibling nodes, but not the whole treeview.
In your case you should implement a recursive search through Nodes collection to find all nodes having required Key value.