?
Solved

Access value of treeview child

Posted on 2006-11-28
2
Medium Priority
?
298 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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

850 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