Home - Forums-.NET - FlyTreeView (ASP.NET) - Find node value associated to a particular child C#

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

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

Find node value associated to a particular child C#
Link Posted: 15-Aug-2007 01:44
How can I find the node value associated to a particular child ?

C#
TreeView.SelectedNode:

Find/Get node-value in root node ?

Find/Get node-value in node level2 ?
Link Posted: 15-Aug-2007 01:58
What do you mean by \"value\"?
Is it what you store in node.Value property?

There's node.Parent property and node.ChildNodes collection that you can navigate to get required nodes and values associated with them.
Link Posted: 15-Aug-2007 02:01
Yes, store in node.Value property
Link Posted: 15-Aug-2007 02:13
So basically you need to get parent node for the specified level.

This can be achieved using a code like this:


FlyTreeNode parent = node;
do
{
   parent = parent.Parent;
   if (parent.Level == requiredLevel) return parent;
}
while (parent != null);


For root node requireLevel should be set to 0