-
Treeview node location
OK ive got a treeview control to display customers and orders
first node level is perant name of "Customers"
Second Node level is the customer names
thrid node level is the order
i do a TreeView1_AfterSelect to find out what tag ive clicked on
however i also need to find what lever the selected node is.
Is there a nice way to find out what level the selected node is at
-
If I'm not mistaken there's a Path (or FullPath) property that returns the node as a folderpath.
e.g. RootNode\SubNode1\SubNode3\SelectedNode.
Ofcourse, that's just a string. If you need the nodes them selves you would have to recursivly loop backwards by using the parent property of each node.
But if I understand your question right the string above should be enough. Just split it into an array and you can count the length of the array to get the level.
Hope it helps.