473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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

Jun 17 '06 #1
2 4461
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" <an*****@pandora.be> wrote in message
news:ov***********************@phobos.telenet-ops.be...
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

Jun 19 '06 #2
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" <an*****@pandora.be> wrote in message
news:ov***********************@phobos.telenet-ops.be...
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

Jun 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jeroen Ceuppens | last post by:
Hi, I want to make something that adds a TreeNode to the end of TreeView, that TreeView Looks like + Level 1 + Level 2 + Level 3 - Level last
5
by: nevin | last post by:
Hi, If I have a TreeView with loads of Nodes and they all have children etc, how do I find the index of a given node when I only know the Text value? If I use TreeView.Nodes.IndexOf(new...
2
by: Benny Raymond | last post by:
More problems with this... When I run this code, the main form returns an invalid cast exception as it's executing the line "TreeNode n = (TreeNode) this.Nodes;" Does anyone know what would...
2
by: Wes | last post by:
I have a treeview that I am continually added nodes to. Each time a new node is added I would like to select that node. Is this possible? I have looked at selectedNode, but I don't know how to...
3
by: markaelkins | last post by:
Hi. I am trying to enter a variable in the treenodesrc of a treenode. I am basically trying to send an ID variable into sql to return different records. I've searched everywhere and cannot find the...
1
by: sklett | last post by:
I know, I know... it's rarely the case. But here is a SIMPLE example of it not working: TreeNode temp = configNode.Nodes.Add("TestNode"); TreeNode findResult = configNode.Nodes.Find("TestNode",...
0
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
1
by: jmDesktop | last post by:
I am trying to add nodes with keys to my treeview. I can add general nodes without problem with: //create new node TreeNode newNode = new TreeNode(myIdNumber); //create children TreeNode...
2
by: dutsnekcirf | last post by:
I found this article on how to nudge the treenode items up or down in the order of a treeview control. The problem is it's in C# and I know nothing about C#. In fact, C# scares me (I think it's the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.