Self-Referencing RadGridView does not display children as itself

1 Answer 21 Views
GridView
Stan
Top achievements
Rank 1
Stan asked on 05 Apr 2025, 04:46 PM | edited on 05 Apr 2025, 06:19 PM

When reading https://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/self-referencing-grid I was expecting that `Self-Referencing` RadGridView means it uses own columns and rest visual stuff to display all nested child RadGridViews. Since it references the same type in the underlying data on every hierarchy level (that is self-referencing), it's obviously should display all levels in the same way (as it displays itself on top-level). 

Turned out it was not the case. Each child level requires own visual template, own columns with own styling. We have about 20 columns with heavy styling each (more than 500 lines in .xaml) for top-level `RadGridView`. Copy-pasting all that into `RadGridView.HierarchyChildTemplate` is not an option.

In your demo application, I saw that you add columns manually for a child `RadGridView` from `RadGridView1_DataLoading` handler in code-behind. I was hoping it was a mistake.

 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 08 Apr 2025, 06:20 AM

Hello Stan,

Indeed, the self-referencing data mechanism will still require to manually adjust the child RadGridView columns and other settings. I think that the RadTreeListView control will be more suitable for this scenario. It doesn't support self-referencing data, but it has a more consistent hierarchy-related mechanisms and visualization. You can see the following article for a code idea for converting flat (self-referencing) collection to a hierarchy.

Regards,
Martin Ivanov
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

Tags
GridView
Asked by
Stan
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or