CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2001
    Location
    Denmark
    Posts
    21

    bind a treenode text property to a treenode TAG property, Quickly please

    Hey

    I have e treeview with a lot of nodes. each node has a tag object. the object has a Name property which set/get a string. Now I want to bind the nodes.Text to the TAG's Name property, but how??? is it possible

  2. #2
    Join Date
    Dec 2000
    Location
    Slovakia
    Posts
    1,043
    Yes it is...

    Add variable (say ParentNode) which will point to the TreeNode into the class of the object you are assigning to the Tag proprerty of the TreeNode. Initialy set it to null.

    Create Name property it that class and during the setting its value set also the Text property of the TreeNode where the ParentNode property points.

    Derive your own TreeNodeEx class from the .net framework's TreeNode.

    Override property Tag and during the setting that property set also the Text property to the value of the Name property of the object...

    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured