get the value of the selected node in a treeview

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

hi
i'm trying to get the value of the selected node in my treeview.
my code is:

txtTable1.Text = tvRelations.SelectedNode.Parent.ToString

but it adds the string 'TreeNode: ' to the value of the node (_56Zones)
as such:

TreeNode: _56Zones

Why ? and how can I get rid of that w/o having to use string functions
?

thx
 
Sam said:
i'm trying to get the value of the selected node in my treeview.
my code is:

txtTable1.Text = tvRelations.SelectedNode.Parent.ToString

but it adds the string 'TreeNode: ' to the value of the node (_56Zones)
as such:

TreeNode: _56Zones

Use 'SelectedNode.Parent.Text' instead. If you are storing a value in the
node's 'Tag' property, use 'SelectedNode.Parent.Tag.ToString()' to convert
the value to a string.
 
Back
Top