-
I have a "Treeview" object and I want to know if there
is a function that can return the level that I locate.
For example: there are 3 levels for a specific treeview
and my location is on an item that exists on the second level.
I'm looking for a function that can return to me - "2".
Thank you
Royi
-
Use Fulpath property
Just use the Fullpath property of the selected item and set the PathSeperator property of the treeview to whatever you want it to be (most likely '/')
On the assumption you don't use the path seperator in the node text, you can easily count the level of the node by counting the number of occurences of the path seperator in the FullPath. Just write a function for that and feed it with FullPath string.
Maybe there's a better way but this one works too.