treenode find node

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • andreas

    #1

    treenode find node

    Hi,
    I have a problem with treenode
    I know the node.text of a selected node in a variable and then some nodes
    are removed but not the selected node who is no more selected (so using
    index and level are changed)
    How can I find the node by the name I know.
    I know a methode in a treenode with one rootnode with a recurse procedure to
    test each node But is there no faster way?
    Thanks for any response



  • Claes Bergefall

    #2
    Re: treenode find node

    Since you're not removing the selected node you can store a reference to it
    in a variable (i.e. the whole node, not just the text). Once done just use
    the Selected property to select it again

    /claes

    "andreas" <andreas@pandor a.be> wrote in message
    news:ovQkg.4869 11$ZV4.12407837 @phobos.telenet-ops.be...[color=blue]
    > Hi,
    > I have a problem with treenode
    > I know the node.text of a selected node in a variable and then some nodes
    > are removed but not the selected node who is no more selected (so using
    > index and level are changed)
    > How can I find the node by the name I know.
    > I know a methode in a treenode with one rootnode with a recurse procedure
    > to
    > test each node But is there no faster way?
    > Thanks for any response
    >
    >
    >[/color]


    Comment

    • giannik

      #3
      Re: treenode find node

      in .net 2.0 this is supported . There is
      a treeview.Nodes. Find(NodeName, SearchCildren)
      method that goes down the treeview and returns an array of treenodes.
      Giannis


      "andreas" <andreas@pandor a.be> wrote in message
      news:ovQkg.4869 11$ZV4.12407837 @phobos.telenet-ops.be...[color=blue]
      > Hi,
      > I have a problem with treenode
      > I know the node.text of a selected node in a variable and then some nodes
      > are removed but not the selected node who is no more selected (so using
      > index and level are changed)
      > How can I find the node by the name I know.
      > I know a methode in a treenode with one rootnode with a recurse procedure
      > to
      > test each node But is there no faster way?
      > Thanks for any response
      >
      >
      >[/color]


      Comment

      Working...