473,666 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4480
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*****@pandor a.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*****@pandor a.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
5257
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
10231
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 TreeNode(textvalueofname)) it always returns -1 and a TreeView.Nodes.Contains(etc.. always is false. I expect that it is only looking in the local Nodes collection rather than every single node in the TreeView. So how do I easily find any given node in...
2
2392
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 cause this? I just want to be able to use my own node class so that I can store extra data... =========================
2
21741
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 point that at a given node using the nodes name. I have the nodes name and it's parents name. Does anyone know a good way to find the node based on this information? Thanks a bunch.
3
1831
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 answer. I'd appreciate and help. Thanks. What I'm doing is creating a treeview with the structure as follows (this is the expanded view): - Item Status - Item Status Details
1
15625
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", false); The call to Add works, but I always get a 0 length array back from Find() Anyone see the problem?
0
3298
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. Provide following view properties to listview, through View menu a. Tile b. Icon
1
7381
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 myPersonNode = new TreeNode(myPerson); TreeNode myAddressNode = new TreeNode(myAddress);
2
1413
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 pound sign, idk...or maybe it's the letter C) I've included the code here. Could someone do me the huge favor of converting it to VB.Net? public bool NudgeDown(TreeNode node) { int newIndex = 0; TreeNode nodeClone = null;...
0
8449
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8360
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8876
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8642
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6198
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2774
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1777
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.