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

Treeview Howto

I have user selecting a branch on a treeview. Is it possible to gather the
values of all child nodes of the selected node, and put the values into an
arraylist? If you have any examples I would appreciate it.
Nov 9 '06 #1
2 1143
nevermind I figured it out

http://msdn2.microsoft.com/en-us/library/wwc698z7.aspx

"Toco" wrote:
I have user selecting a branch on a treeview. Is it possible to gather the
values of all child nodes of the selected node, and put the values into an
arraylist? If you have any examples I would appreciate it.
Nov 9 '06 #2
On 09/11/2006 in message
<66**********************************@microsoft.co mToco wrote:
>I have user selecting a branch on a treeview. Is it possible to gather the
values of all child nodes of the selected node, and put the values into an
arraylist? If you have any examples I would appreciate it.
Something like this will pick up the first level nodes, if you want their
children it would need to be recursive.

ArrayList al = new ArrayList();
TreeNode tnSelected = tv.SelectedNode;

foreach(TreeNode tNode in tnSelected.Nodes)
al.Add(tNode);

--
Jeff Gaines
Nov 9 '06 #3

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

Similar topics

4
by: Josef Sachs | last post by:
Is Andrew Kuchling's regex-to-re HOWTO available anywhere? I've found the following (dead) links on various Web pages: http://py-howto.sourceforge.net/regex-to-re/regex-to-re.html...
1
by: dave | last post by:
What is the most effecient method to take data from a database table (sqlserver) to a vb.net treeview control. The database table looks like ID, Name, ParenetID 1 , test, <null> 2, test2, 1...
42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
5
by: SoKool | last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control. I intend to use a treeview to generate a...
1
by: Lars Grøtteland | last post by:
Hello! I would like this to happen: In my treeview - I have 4 main group, and about one hundred items under these four. Are there any way of making the selection under the fourth item, item...
6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
14
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
6
by: serge calderara | last post by:
Dear all, I was wondering is there is a way to customise the treView control in order to get any Control as a Node. What I try to do is having a Progress bar as a treeview node object. Is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...

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.