By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,279 Members | 1,244 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,279 IT Pros & Developers. It's quick & easy.

get the value of the selected node in a treeview

P: n/a
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

Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Sam" <sa**************@voila.fr> schrieb:
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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.