Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Go to a specified node in treeview

Go to a specified node in treeview

Scheduled Pinned Locked Moved C#
question
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Laji59
    wrote on last edited by
    #1

    I want to set and focus to a specified node in treeview.it means I want to go to specified node in treeview How can I do it ?

    Hello Friends

    D K 2 Replies Last reply
    0
    • L Laji59

      I want to set and focus to a specified node in treeview.it means I want to go to specified node in treeview How can I do it ?

      Hello Friends

      D Offline
      D Offline
      DaveyM69
      wrote on last edited by
      #2

      Iterate through your treeview until you find the one you need, then set the treeviews SelectedNode property and call the selectednode's EnsureVisible method.

      Dave
      BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
      Expect everything to be hard and then enjoy the things that come easy. (code-frog)

      A 1 Reply Last reply
      0
      • D DaveyM69

        Iterate through your treeview until you find the one you need, then set the treeviews SelectedNode property and call the selectednode's EnsureVisible method.

        Dave
        BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
        Expect everything to be hard and then enjoy the things that come easy. (code-frog)

        A Offline
        A Offline
        Abdul Rahman Hamidy
        wrote on last edited by
        #3

        Simply you can find tree node within treeview using the find method as show below string myNodeName="abc" TreeNode[] node=new TreeNode[1]; node=treeView1.Nodes.Find(myNodeName,true); treeView1.SelectedNode=node[0]; this is simple way how u can find your node within the treeview

        Abdul Rahaman Hamidy Senior Student Student in Computer Science Kabul, Afghanistan Software Developer

        1 Reply Last reply
        0
        • L Laji59

          I want to set and focus to a specified node in treeview.it means I want to go to specified node in treeview How can I do it ?

          Hello Friends

          K Offline
          K Offline
          Kevin Marois
          wrote on last edited by
          #4

          I HAVE ALREADY ANSWERED THIS. There is no reason to repost it.

          Everything makes sense in someone's mind

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups