473,396 Members | 1,929 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,396 software developers and data experts.

Treeview Search

Hi
I'm trying to do a text search on a TreeView control. So far I've been able
to find the matching items and add them to another treeView but I want to be
able to add its whole path to the other treeView and not just the matching
node.
Any ideas on how to do this?
Jan 16 '06 #1
1 3564
You will need to implement a simple recursive routine:

TreeViewWalk(treeView.Nodes);


private void TreeViewWalk(TreeNodeCollection nodes)
{
foreach (TreeNode node in nodes)
{
// do what you want to do with 'node' here.

if (node.ChildNodes.Count > 0)
{
TreeViewWalk(node.ChildNodes, list);
}
}
}

--

Andrew Robinson
blog.binaryocean.com
www.binaryocean.com
"AlexDP" <Al****@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
Hi
I'm trying to do a text search on a TreeView control. So far I've been
able
to find the matching items and add them to another treeView but I want to
be
able to add its whole path to the other treeView and not just the matching
node.
Any ideas on how to do this?

Jan 16 '06 #2

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

Similar topics

0
by: marian | last post by:
Hi I have changed the control in my form to a Treeview 6 instead of 5 and my code no longer works as before. Can anybody help me here. There are no errors, but I only end up with the first...
0
by: imassadpk | last post by:
Hi all, Apprecite your help in resolving this tricky issue... I am trying implementing Recurrsive TreeView in MS. Access 2003 ADP project. So far, no luck :( The Problem: This sample...
4
by: Ben Coats | last post by:
Hey, I'm trying to find code for an Explorer-style Directory ComboBox. (You know, it display "Desktop", "My Computer", all drives, etc., but it has a treeview control inside the combobox so that...
1
by: Mark | last post by:
Hello, I am using the new TreeView in ASP.Net 2.0. I am using its PopulateOnDemand feature. The problem is that the treeviews +/- images, and any checkboxes, have the tooltip set. If the node...
0
by: Dianna | last post by:
Hi, I am doing a recursive search of my treeview. All I am doing is iterating through the nodes and checking if my tag = my id. It seems to works, finds the ID, selects it and exits. However,...
3
by: Franky | last post by:
Been having a problem using a treeview. Work great the first time the form containing it is entered but not the second time. Took a while to create a small sample that exhibits the problem, but...
3
by: Jeff | last post by:
Hey ..NET 2.0 I'm trying to search a TreeView control for a specific TreeNode The code below doesn't work because it only searches the the top level of the nodes. I would like to program it...
2
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
My first time using a TreeView: I've got a TreeView that I populated with some data and it has nodes. In the Properties window, I created an Event Handler for the TreeView's AfterSelect...
5
by: Max2006 | last post by:
Hi, I have a TreeView and this is my node style: <asp:TreeNodeStyle ForeColor = "#000000" Font-Size="9px" Font-Bold="false" Width="100px" NodeSpacing="3px" /> The problem is the expand...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
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
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...

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.