locked
Editing self-referential tables using a treeview control? RRS feed

  • Question

  • I have a self-referential database table that is used to define a tree like structure.  Is it possible to edit this using some form of tree control with node add/delete etc?
    Wednesday, August 25, 2010 2:37 AM

Answers

  • I would say that it is possible to do, but it would be a very complex control to author.  It would be possible to use the Custom Control feature of the Screen Designer and then wire up the control for that particular screen, but I can see it being more useful (and easier to work with) as a full-fledged extension.

    LightSwitch does not provide any hierarchical controls (such as a TreeView) out-of-the-box.  I would anticipate that control vendors and extension authors would be interested in exploring hierarchical controls for LightSwitch.  At the very least, it would prove as a very interesting case study.

    We will be releasing more information about the extensibility of LightSwitch in the near future.

    Thursday, August 26, 2010 8:13 AM

All replies

  • I would say that it is possible to do, but it would be a very complex control to author.  It would be possible to use the Custom Control feature of the Screen Designer and then wire up the control for that particular screen, but I can see it being more useful (and easier to work with) as a full-fledged extension.

    LightSwitch does not provide any hierarchical controls (such as a TreeView) out-of-the-box.  I would anticipate that control vendors and extension authors would be interested in exploring hierarchical controls for LightSwitch.  At the very least, it would prove as a very interesting case study.

    We will be releasing more information about the extensibility of LightSwitch in the near future.

    Thursday, August 26, 2010 8:13 AM
  • From your post it would seem like you're using a table with a field that has a different field in the same table as foreign key.

    I would urge you to not use this type of system as it requires recursion to determine tree structure unless your tree is of fixed depth.  Instead look at using "L and R values" which you can find more information about at http://www.ibase.ru/devinfo/DBMSTrees/sqltrees.html and http://kamfonas.com/id3.html.

    You might also be interested in Joe Celko's book "Trees and Hierarchies in SQL for Smarties" - http://www.amazon.com/Hierarchies-Smarties-Kaufmann-Management-Systems/dp/1558609202.

    You might also find it a lot easier to program a tree view control using L&R's.

    Best,
    Clay

    Wednesday, December 1, 2010 4:50 AM