Solved

Access value of treeview child

Posted on 2006-11-28
2
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

724 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