Solved

Access value of treeview child

Posted on 2006-11-28
2
286 Views
Last Modified: 2010-04-23
I dynamically create a treeview that can have multiple levels like this:

parent node
   - node 0
      - child 0
      - child 1
         - subchild 0
         - subchild 1
         - subchild 2

I am using TreeView1_AfterSelect event to access first 2 levels of tree like this:

selParent = e.Node.Parent.Text
selNode = e.Node.Text

This will give me the value of the parent node and node, but how can I get the value of child or subchild nodes when they are clicked?

0
Comment
Question by:jamesr1411
2 Comments
 
LVL 29

Accepted Solution

by:
Nightman earned 250 total points
ID: 18032288
perhaps I am not understanding you clearly but e.Node.text will always be the valule of the node that is clicked, regardless of it's depth in the tree. So if you click on subchild 1, e.Node.Text will be "subchild 1".
0
 

Author Comment

by:jamesr1411
ID: 18036702
Nightman,

I'm a dumb***. You are right, it was the way I was testing for the value. I was doing a msgbox within a select statement looking for parent values, so clicking on child or subchild would not return any value...

Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now