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

Treeview Node Key

P: n/a
This is probably a dumb question. But how do you get the key from a treeview node object?

thanks

--
Adhal Freeware
http://www.adhal.org
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Jun 25, 3:11*pm, Adhal <u...@example.netwrote:
This is probably a dumb question. But how do you get the key from a treeview node object?

thanks

--
Adhal Freewarehttp://www.adhal.org
Hi,

You don't :)

TreeNode has no Key

It does have a Tag property tough
Jun 27 '08 #2

P: n/a
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You don't :)

TreeNode has no Key

It does have a Tag property tough
Duh! :-!

That's confusing.

The intellisense tip says:
..Nodes.Add(string key, string name);

So the *key *is the *name *of the node?

Thanks Ignacio

--
Adhal Freeware
http://www.adhal.org
Jun 27 '08 #3

P: n/a
On Wed, 25 Jun 2008 13:25:25 -0700, Adhal <us**@example.netwrote:
[...]
The intellisense tip says:
.Nodes.Add(string key, string name);

So the *key *is the *name *of the node?
Yes, the key you pass to TreeNodeCollection winds up being the Name
property of the TreeNode.

Since it's the string you'd use to look up the TreeNode instance in the
collection, that is in effect a key. I don't think it's really correct to
say that TreeNode has no key, even if it doesn't have something literally
called a "key".

Please don't post HTML.

Pete
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.