Dataset databinding question

3 posts, 1 answers
  1. Gene
    Gene avatar
    64 posts
    Member since:
    Dec 2007

    Posted 19 Mar 2009 Link to this post

    I'm having trouble binding a dataset to a treeview, and am hoping to get some help.

    I have a dataset that essentially flattens a couple of relational tables (Biz Segments, Biz Units, and Facilities).

    The dataset look like:


    I want the tree to look like:


    What is the best way to go about binding the tree to this type of dataset?

    Thanks in advance,
  2. Answer
    Atanas Korchev
    Atanas Korchev avatar
    8462 posts

    Posted 20 Mar 2009 Link to this post

    Hello Gene,

    I think RadTreeView cannot automatically bind to this type of data. What it can bound to is self referencing tables. Please check this help article for additional info.

    All the best,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Gene
    Gene avatar
    64 posts
    Member since:
    Dec 2007

    Posted 23 Mar 2009 Link to this post

    Thanks for the response Albert.

    We ended up refactoring the DataSet into a Parent/Child structure (below) and binding to that.

    nodeID, parentID, name
    bs.1, null, SegA
    bu.1, bs.1, UnitA
    fs.1, bu.1, FacilityA
    fs.2, bu.1, FacilityB
    bs.2, null, SegB
    bu.2, bs.2, UnitB
    bu.3, bs.2, UnitC

    The short of it is that we concatenate an "identifier" to the primarykey and use that to differentiate the different heirarchies.

    Perhaps you guys could put a couple more attibutes on the treeview to differentiate a node's type and parent type for the different branches of your tree.

    Thanks again!
Back to Top