View Single Post
  #7 (permalink)  
Old 08-13-2008, 10:49 AM
daPoet daPoet is offline
VB.NET Forum Newbie
.NET Framework: .NET 2.0 (VS 2005)
 
Join Date: Jul 2008
Age: 25
Posts: 23
Reputation: 23
daPoet is on a distinguished programming path ahead
Wink

Like John H says, the
Code:
 e.node
or the [e.node.Tag] or the [e.node.Text] can be used

e.g. I use the e.node.Tag for doing specific actions like loading employee records from a form(or more like a subform) into a panel on my parent form that also has the tree.

If what John H mentioned doesnt help, try rephrasing your question. I'm also working with the tree control now and the e.node is the real trick to most "which node have i clicked and what should happen " problem


Question: Have you set the tag properties for each node in the section of your code for the tree control...

e.g.
Code:
Dim childrow As DataRow
                Dim childnode As TreeNode
                childnode = New TreeNode()
                For Each childrow In parentrow.GetChildRows("DeptToJob")
                    childnode = parentnode.Nodes.Add(childrow(0) & " " & childrow(1) & " " & childrow(2))
                    childnode.Tag = childrow("dept_id")
then I can use the
Code:
e.node.tag
to return a value to a form or a text box or a listbox

e.g. under the
Code:
treeView1_afterSelect
I can use an
Code:
textbox1.text = e.node.tag
something like that..

hope this helps

Last edited by daPoet; 08-13-2008 at 10:58 AM.
Reply With Quote