TreeView and hierarchical data support with Dynamic Data? RRS feed

  • Question

  • User-484657313 posted

    Hi everybody!

    My database has table with data that is logically hierarchial. It has ID and ParentID. If ParentID is NULL then this node is the root node, otherwise ParentID points to a parent node, this table also contains other data columns.

    Example of such data:

    - Groups hierarchy:

        -- Profit organizations

          --- Banks

          --- Investment companies

          --- Insurance companies

        -- Non profit organizations

          --- Charity founds

          --- Other companies

    So the question: Is it possible to bind this data to a TreeView instead of GridView with the help of Dynamic Data?


    It's not a problem for me to create CustomPage template and to fill it with the data using Linq or Entities, but it doesn't seems like something dynamic. What i've wanted was the reusable template like List.aspx. I wanted that template (lets call it Tree.aspx) to fetch current MetaTable and to show it's contents.

    I've investigated a little and found out that TreeView's datasource should be an implementation of IHierarchicalDataSource which I don't know how to implement using MetaTable as input. From the other side I also can't populate TreeView on the fly because SomeMetaTableInstance.GetQuery() returns IQueryable which is not strongly typed and therefore i don't know how it can be Linq'ed...

    Thank you in advance!

    Monday, October 6, 2008 11:37 AM

All replies

  • User-330204900 posted

    Hi Cheburawka, i don't think DD would help here, I had a project where I was tracing the functions in a Powerhouse program library imported into two tables function details table and a link table and then visualised in a tree view. I can e-mail my project to you is you want as it has no use now.

     hope this helps [:D]

    Monday, October 6, 2008 7:02 PM
  • User-484657313 posted
    Hmm, i see, well that's bad. Thank you for your project but i think i will just use CustomPage templates, since it wouldn't take time to get in to it. Any way thank you for reply.
    Tuesday, October 7, 2008 4:01 AM
  • User-330204900 posted

    Hi Cheburawka, no problem [:D]

    Tuesday, October 7, 2008 4:26 AM