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?
P.S.
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!