CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: help

  1. #1
    Join Date
    Sep 2000
    Posts
    24

    help

    Problem: I need to create a treeview for an assembly. So for example, if I was creating an assembly for a car, one level might be door, the next level maybe handle, and so on, documenting the parts of the door. Logically each level should be a new table (so the handle table will store all the parts that make up the handle). This structure needs to be dynamic so that they can have as many levels as they want. Therefore I will need to add and delete tables from the app. Has anyone done anything like this before, and if so, could I have a copy.


  2. #2
    Join Date
    May 2001
    Posts
    46

    Re: help

    You can achieve this with only to tables, one (recursive) with the parent/children, and another with the parameters for each caracteristic, so:

    Table 1
    Key,
    Parent
    (where parent is foreign key for each Key(the column))

    Table 2
    Key,
    Description

    So, In table 2 you store each value:

    Key Descripcion
    1 Car
    2 Door
    3 Handle
    4 Engine
    5 Battery


    In table 1:

    Key Parent
    1 2 (door under car)
    2 3 (handle under door)
    1 4 (engine under car)
    4 5 (Battery under engine)

    then you reference table number 1 to create the tree and table 2 to retrieve the description for each item...

    Hope this helps as an idea...

    Let me know...



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