Heirarchical Binding

4 posts, 1 answers
  1. Richard Weeks
    Richard Weeks avatar
    95 posts
    Member since:
    Oct 2009

    Posted 26 Jul 2011 Link to this post

    Hi,

    I have two columns available for creating a heirarchical treeview:

    PositionNumber ReportsTo
    10030          10004
    10122          10030
    10838          10030
    10923          10030
    11015          10030
    11015          10030
    11229          10030
    11422          10030
    11453          10030

    When binding, I get the error "These columns don't currently have unique values".

    I understand the error. There are two '11015' PositionNumber values. These are two distinct records thast have the same position number... How can I make my treeview use the values as set out above?

    Actually, I don't care what the control is just so long as I can view my data heirarchically presented. If another control is more suited, do let me know!

    Thanks,
    Richard
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 27 Jul 2011 Link to this post

    Hello Richard,

    Please take a look at the help article which explains the same.
    Binding to Hierarchical Data.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Richard Weeks
    Richard Weeks avatar
    95 posts
    Member since:
    Oct 2009

    Posted 27 Jul 2011 Link to this post

    In PositionNumber, there are 2 identical values. This makes sense in my scenario as these are two completely different people who just happen to have the same position and report to the same person, to refresh:

    Name   PositionNumber ReportsTo 
    Bob    11015          10030 
    Alice  11015          10030 

    How can I cater for that?

    Richard

  5. Answer
    Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 29 Jul 2011 Link to this post

    Hello Richard,

    In order to be able to bind your treeview to your hierarchical data source, you should have a primary key for this table. This is needed because you should have a unique identifier for every record which could be assigned  as DataFieldID, your "ReportsTo" will be DataFieldParentID and you could use the "PositionNumber" to be bound as a DataValueField.

    Unless you have unique identifier you won't be able to achieve the desired functionality.

    Regards,
    Dimitar Terziev
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top