This is a migrated thread and some comments may be shown as answers.
Gridview hierachical with many parent for one child
1 Answer 5 Views
This is a migrated thread and some comments may be shown as answers.
Bao
Top achievements
Rank 1
Bao asked on 17 Feb 2018, 05:34 PM

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

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Feb 2018, 09:49 AM
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: https://docs.telerik.com/devtools/winforms/gridview/hierarchical-grid/self-referencing-hierarchy

I hope this information helps. Should you have further questions I would be glad to help. 
 
 Regards,
Dess
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.
Asked by
Bao
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or