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

Treeview nodes

Hi there,

I have a treeview in my ms access form.
How can I get list of all nodes(Direct or indirect) under any particular node I would select.

For example my treeview is
1
a
a1
a2
b
2
x
x1
x1.1
x1.2
x2

If my starting point is 1 it should give me list like(May be I would save it in a table)

1
a
a1
a2
b

if my starting point is x then it should give me
x
x1
x1.1
x1.2
x2

Please help

Thanks,
Yogesh
Aug 16 '07 #1
2 3547
FishVal
2,653 Expert 2GB
Hi there,

I have a treeview in my ms access form.
How can I get list of all nodes(Direct or indirect) under any particular node I would select.

For example my treeview is
1
a
a1
a2
b
2
x
x1
x1.1
x1.2
x2

If my starting point is 1 it should give me list like(May be I would save it in a table)

1
a
a1
a2
b

if my starting point is x then it should give me
x
x1
x1.1
x1.2
x2

Please help

Thanks,
Yogesh
Hi, Yogesh.

The most suitable solution is recursive (calling itself) procedure.
something like this

Expand|Select|Wrap|Line Numbers
  1. Public Sub EnumerateChildNodes(nodStart As MSComctlLib.Node)
  2.  
  3.     Dim nodNode As MSComctlLib.Node
  4.  
  5.     Debug.Print nodStart.Text
  6.     If nodStart.Children = 0 Then Exit Sub
  7.  
  8.     Set nodNode = nodStart.Child
  9.     Do
  10.         EnumerateChildNodes nodNode
  11.         Set nodNode = nodNode.Next
  12.     Loop Until nodNode Is Nothing
  13.  
  14. End Sub
  15.  
  16.  
Aug 16 '07 #2
Hi, Yogesh.

The most suitable solution is recursive (calling itself) procedure.
something like this

Expand|Select|Wrap|Line Numbers
  1. Public Sub EnumerateChildNodes(nodStart As MSComctlLib.Node)
  2.  
  3.     Dim nodNode As MSComctlLib.Node
  4.  
  5.     Debug.Print nodStart.Text
  6.     If nodStart.Children = 0 Then Exit Sub
  7.  
  8.     Set nodNode = nodStart.Child
  9.     Do
  10.         EnumerateChildNodes nodNode
  11.         Set nodNode = nodNode.Next
  12.     Loop Until nodNode Is Nothing
  13.  
  14. End Sub
  15.  
  16.  

Thank you so much,

This works great!!
Aug 17 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: serge calderara | last post by:
dear all, Is there an easy way to bind a treeview control with an XML object as datasource? In a similar way as the dataset is doing, and build columns accroding to XML node, I could imagine a...
4
by: alanrn | last post by:
I am using a TreeView to display the hierarchy of a strongly-typed collection (inherited from CollectionBase). The order of the nodes in the TreeView is strictly tied to the order in which they...
3
by: Steve Richter | last post by:
in windows explorer, the nodes immed under the "my computer" root node appear with a minimum of indenting ( the +/- square is directly underneath the root node ). In the .NET TreeView control the...
5
by: Mark Goldin | last post by:
Anybody can shart some working samples of using that control on Windows form? Thanks
4
by: Ian Powell | last post by:
Hi I've got objects in an sorted ArrayList like: P:\ P:\\DOCS P:\\i386 P:\\i386\ASMS P:\\i386\ASMS\1000 P:\\i386\ASMS\1000\MSFT
3
by: Jan Wrage | last post by:
Hi! I would like to implement a treeview in my existing application. It should show my entire Active-Directory structure, i.e. all Groups, Containers and OUs. Could somebody help me with...
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
1
by: | last post by:
What's the best way to create new nodes on a treeview 2.0 and save them to an xml file? Thanks, Victor
0
by: apenly | last post by:
Hi all- I'm trying to Render a TreeView in a custom control, but I'm receiving a NullReferenceException at runtime. If I put the TreeView on the page it works fine, but as soon as I try to...
1
by: doemon | last post by:
Hi, I'm working on a pagination control and I need to dynamically rerender a treeview to display the next set of nodes depending on which page we're on. For example, page 1 will dispaly only...
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: 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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.