Results 1 to 2 of 2

Thread: Treeview node location

  1. #1

    Thread Starter
    Fanatic Member carlblanchard's Avatar
    Join Date
    Sep 2003
    Location
    Bournemouth (UK)
    Posts
    539

    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
    I am curretly building a defect management system for software and web developers,
    If you wana try it out (beta test) and keep it for free just send me a message

  2. #2
    Fanatic Member pax's Avatar
    Join Date
    Mar 2001
    Location
    Denmark
    Posts
    840
    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.
    I wish I could think of something witty to put in my sig...

    ...Currently using VS2013...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width