Solved

Access value of treeview child

Posted on 2006-11-28
2
285 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
Comment Utility
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
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

9 Experts available now in Live!

Get 1:1 Help Now