Treeview: return keyvalue selected node

Bartbcip

New member
Joined
Jun 7, 2007
Messages
1
Programming Experience
3-5
Hey there!

I have a treeview in my application and I have automatically added nodes to the treeview using
JobView.Nodes(0).Nodes(0).Nodes.Add(AJob.JobID.ToString, AJob.Name)
where AJob is of the type Job.
I'm adding also a keyvalue to the node.

When I want to determine the selected node using the AfterSelect Method, how can I get the key of the selected node?

I Only managed to get the Node´s text
JobView_AfterSelect (ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles JobView.AfterSelect
MessageBox.Show(e.Node.Text)
End Sub

Somebody?
Thanx,

Nose:D
 
.Name property of the node is the key.
 
Back
Top