Adding Data to TreeView Nodes

Discussion in 'Basic4ppc Wishlist' started by Woinowski, Aug 23, 2007.

  1. Woinowski

    Woinowski Active Member Licensed User

    Hi,

    I'd like to be able to add data (a string, number or even arbitrary variable type) to each tree node.

    As an example: imagine a notepad with a tree structure (there's a lot of those out there, just an example).

    You would be able to navigate through the tree to your notes and each node could contain a note(text string).

    Currently, I can only think of awkward workarounds (e.g., simulating a tree with the same structure in an ArrayList).

    Just using the Node.Text member is not the correct idea: In the tree view I would only want to show titles of the notes/nodes.
    Jens
     
    Last edited: Aug 23, 2007
  2. Woinowski

    Woinowski Active Member Licensed User

    Addition: Look at Visual Studi

    To make my idea clear:

    In visual studio the TreeView-Node Class has a member "Tag" for user defined data (in C#) That's just what I am looking for....
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    The Tag property of .Net Framework controls is only available on the full framework (not .Net CF).
     
  4. Woinowski

    Woinowski Active Member Licensed User

    And it is not possible to add something similar, even a simple string tag, to the B4PPC library Node class?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    It is possible to add it and I think we will add it.
     
  6. Woinowski

    Woinowski Active Member Licensed User

    Cool. I'm looking forward to that. Currently I have found a workaround:

    I use a tree without images. The image index can be used to reference an item in an arraylist :)
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    Nice solution :)
     
  8. Woinowski

    Woinowski Active Member Licensed User

Loading...