C
Charles
Hello,
I guess I just maybe missing something here. How do you
get the tag property for each child node?
What I have is a collection that I want to get additional
information from to put in a listview control, by using a
key value.
Currently what I have is (in the treeview's AfterSelect
event):
Dim something As CEmployee
Dim ParentNode As TreeNode = e.Node.Parent
Dim tn As TreeNode
Dim lvi As ListViewItem
ListView1.Items.Clear()
If ParentNode Is Nothing Then ' Parent node
'code for clicking on just parent node
For Each tn In e.Node.Nodes
Debug.WriteLine(e.Node.Tag.ToString) 'gives me
the tag of child but does not do for each
something = MyClasses.Item(e.Node.Tag.ToString)
'MyClasses is the collection
lvi = ListView1.Items.Add(tn.Text) 'ee name
lvi.SubItems.Add(e.Node.Text) 'ee
department
'lvi.SubItems.Add(something.Telephone.ToString)
Next
Else ' Child node
'code for clicking on just child node
End If
I guess I just maybe missing something here. How do you
get the tag property for each child node?
What I have is a collection that I want to get additional
information from to put in a listview control, by using a
key value.
Currently what I have is (in the treeview's AfterSelect
event):
Dim something As CEmployee
Dim ParentNode As TreeNode = e.Node.Parent
Dim tn As TreeNode
Dim lvi As ListViewItem
ListView1.Items.Clear()
If ParentNode Is Nothing Then ' Parent node
'code for clicking on just parent node
For Each tn In e.Node.Nodes
Debug.WriteLine(e.Node.Tag.ToString) 'gives me
the tag of child but does not do for each
something = MyClasses.Item(e.Node.Tag.ToString)
'MyClasses is the collection
lvi = ListView1.Items.Add(tn.Text) 'ee name
lvi.SubItems.Add(e.Node.Text) 'ee
department
'lvi.SubItems.Add(something.Telephone.ToString)
Next
Else ' Child node
'code for clicking on just child node
End If