Gridview hierachical with many parent for one child

2 posts, 0 answers
  1. Bao
    Bao avatar
    54 posts
    Member since:
    Jan 2015

    Posted 17 Feb 2018 Link to this post

    Hi , I am using GridviewRelation to show the tree, but my data need to be shown like this:

    Id          ParentId

    1                2

    2                4

    1                6

    It means, sometimes we have the one child belong to many parents. It displays the below error, how can i fix it ?

    Row with id '30' already appears in the hierarchy with parent id '27'. Each row in a self-reference hierarchy can appear only once in the hierarchy

  2. Dess | Tech Support Engineer, Sr.
    Dess | Tech Support Engineer, Sr.  avatar
    3997 posts

    Posted 19 Feb 2018 Link to this post

    Hello, Bao, 

    Thank you for writing.  

    Let me please explain simply how does the self reference hierarchy in RadGridView work. It is necessary to specify a unique Id for each row in the grid. In order to indicate which is the parent for a certain row, set the ParentId field. According to the provided information it seems that you need to add the same row to different parents. For this purpose, it is necessary to use a different Id for the row and keep its other information identical. Thus, you will have the same child row's name in several parents. Additional information how to setup the self-reference hierarchy is available in the following help article:

    I hope this information helps. Should you have further questions I would be glad to help. 
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top