?
Solved

Access value of treeview child

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

Independent Software Vendors: 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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

777 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