Tech Off Thread

8 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Saving a Tree

Back to Forum: Tech Off
  • User profile image
    Turtle

    Hi, can anyone tell me how to save a tree ?

    I have a tree view in visual studio in VB.

    And I want to save the tree so i can edited it over time.

    Does anyone know how to do this ??

    Turtle.

  • User profile image
    Ion Todirel

    Turtle wrote:
    I have a tree view in visual studio in VB.
    i suppose VB.NET?

  • User profile image
    m1keh

    Heh.. i though this was an environmental post..

    But yes, XML would be your best choice.   

  • User profile image
    Sven Groot

    Write it to an XML file.
    So if you have a tree like this
    Node 1
    |-Node 2
    | |-Node 3
    |-Node 4
    Node 5

    You could saven it to something like this:

    <Tree>
       <Node name="Node 1">
          <Node name="Node 2">
             <Node name="Node 3"  />
          </Node>
          <Node name="Node 4" />
       </Node>
       <Node name="Node 5" />
    </Tree>

  • User profile image
    Harlequin

    m1keh wrote:
    But yes, XML would be your best choice.   


    Why? You can build a tree on the fly...

  • User profile image
    JParrish

    As others said XML is a natural choice considering its ability to model the hiearchical data well.

    You may also find it easier depending on your situation to serialize the instance of the control to a binary or xml serialization. I don't do VB, but with a quick google search I found this

  • User profile image
    odujosh

    Take everyone else response and use recursion (it is good for you)

  • User profile image
    Turtle

    thanks for the help.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.