Treeview Node Key

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Adhal

    Treeview Node Key

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

    thanks

    --
    Adhal Freeware

  • Ignacio Machin ( .NET/ C# MVP )

    #2
    Re: Treeview Node Key

    On Jun 25, 3:11 pm, Adhal <u...@example.n etwrote:
    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

    Comment

    • Adhal

      #3
      Re: Treeview Node Key

      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(str ing key, string name);

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

      Thanks Ignacio

      --
      Adhal Freeware



      Comment

      • Peter Duniho

        #4
        Re: Treeview Node Key

        On Wed, 25 Jun 2008 13:25:25 -0700, Adhal <user@example.n etwrote:
        [...]
        The intellisense tip says:
        .Nodes.Add(stri ng key, string name);
        >
        So the *key *is the *name *of the node?
        Yes, the key you pass to TreeNodeCollect ion 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

        Comment

        Working...