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

Referencing treeview child-node

How do I return the level and index of any given node?

Let's say I want to reference the child-node in the third level of a
treeview:

Level-1 -> Level-2 -> Level-3

I'm trying to build the view of folders dynamically, as a node is
doubleclicked, eg:

Level-1: C:\
Level-2: C:\Program Files
Level-3: C:\Program Files\My Program
Thanks in advance for your time and help!
Regards /Morten
Nov 21 '05 #1
2 1663
Hi,

I think this is what you are looking for.
http://msdn.microsoft.com/library/de...lpathtopic.asp

Ken
------------------------------
"Morten Snedker" <morten_spammenot_ATdbconsult.dk> wrote in message
news:fm********************************@4ax.com...
How do I return the level and index of any given node?

Let's say I want to reference the child-node in the third level of a
treeview:

Level-1 -> Level-2 -> Level-3

I'm trying to build the view of folders dynamically, as a node is
doubleclicked, eg:

Level-1: C:\
Level-2: C:\Program Files
Level-3: C:\Program Files\My Program
Thanks in advance for your time and help!
Regards /Morten
Nov 21 '05 #2
On Mon, 6 Jun 2005 06:25:48 -0400, "Ken Tucker [MVP]"
<vb***@bellsouth.net> wrote:
Actually I'd already seen that example in the online help. My lack of
patience made me glance instead of reading and understand - since the
FullPath property is what I was missing out on. I ended up with

Dim myFolder As String

Dim lf As ListFolders
lf = New ListFolders(Foldername, False)

lf.Execute()
Dim lfEnum As IEnumerator = lf.GetFolders.GetEnumerator()

While lfEnum.MoveNext()
myFolder = lfEnum.Current
myFolder = myFolder.Substring(InStrRev(myFolder, "\"))
Me.TreeView1.SelectedNode.Nodes.Add(myFolder)
End While

lf = Nothing
Me.TreeView1.SelectedNode.Expand()
....calling it with the TreeView.SelectedNode.FullPath.

Thx for re-routing me. ;-)

Regards /Snedker
I think this is what you are looking for.
http://msdn.microsoft.com/library/de...lpathtopic.asp

Nov 21 '05 #3

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

Similar topics

2
by: sreddy | last post by:
I am trying to write a sql query on self referencing table. Just to brief ..Database is related to a Hiring department of the Qwest company. I need to generate a Report used by in HR...
1
by: Terry | last post by:
I've seen several posts from people who have seen this flashing in TreeView's when resizing a form. I've noticed it in my app, but only in the child windows. For example, my main form has a...
4
by: DS | last post by:
Can anyone think of a way or point me in the right direction to be able to get a multiline treeview? By this I mean that each TreeNode Label can span say 2 lines (delimited by \n)? Thanks! -Dan
1
by: nicholas | last post by:
I am using Obout TreeView: www.obout.com I would like to implement a page to add and remove categories to a product with the Obout Treeview with checkboxes. Does anyone allready did this and...
5
by: Hutty | last post by:
I have a table that has two columns, Parent and Child. I'm able to populate a IEControls treeview with the Parent column. On the same row as the Parent is the child in the Child colum. How do...
7
by: Metal Rabbit | last post by:
Hi guys I'm needing to create a fairly complex TreeView, but am faltering on a very basic step (as you will gather, I'm new-ish to .net). Simplified, I can't get the creation of two nodes...
1
by: vojinle | last post by:
Hi, Is there any example populating TreeView control from self-referencing database table? Table structure: ID Item_name Parent_ID
2
by: MaPet | last post by:
He. I'm trying to create a treeview that will show data from access database in hierarchical way. Database structure is: ID, FirstName, LastName, IDBoss - IDBoss is referenced to ID. Treeview...
0
by: yogarajan | last post by:
hi all i need proper alignment my treeview looks like <checkbox>Fruits(parent)-134 <checkbox>Mango(child)-45 <checkbox>Orange(child)-45 ...
0
by: Unter | last post by:
Hi all My Treeview is working fine with the following layout 1 Parent 2 Parent 1 Child 2 Child 3 Parent
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.