[Solved] Hierarchical grid - multiple grid on same level

2 Answers 60 Views
GridView
Carl
Top achievements
Rank 1
Bronze
Iron
Iron
Carl asked on 23 Jul 2026, 05:42 PM | edited on 03 Aug 2026, 03:29 PM

I have a hierarchical grid that looks like this:

However, I need it to look like this:

I need the two tabs with the caption table to follow one another on the 3rd level rather than exist side-by-side. How do I accomplish this?

Thanks

Carl

2 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 28 Jul 2026, 09:25 AM

Hello Carl,

You can achieve similar visualization by using the grouping or hierarchy feature of RadGridView. This will allow you to create a hierarchy of items with the Payments and Returns values at the bottom.

Regards,
Martin Ivanov
Progress Telerik

Modernizing a WinForms application? Use the AI-powered WinForms Converter to simplify migration to Telerik UI for WinForms.
Carl
Top achievements
Rank 1
Bronze
Iron
Iron
commented on 03 Aug 2026, 03:27 PM | edited

Martin

I finally got back to this and found this article which got me to where I need to be:

https://www.telerik.com/products/winforms/documentation/knowledge-base/pageview-mode-in-nested-gridview-levels

The problem now is the headers are not looking right.

When collapsed they look like this:

When I expand it looks like this:

 

I don't need the first Returns header. I need the first grid to be captioned as Payments and the second as Returns, preferably with a gray bar to offset it from the data.

My code is attached. What am I missing here?

Thanks

Carl

Martin Ivanov
Telerik team
commented on 19 Aug 2026, 01:51 PM

Thank you for the extra information. I've used it to setup a sample project, but couldn't reproduce the exact visualization. However, the first Returns is probably the page view header. You can hide this by overriding the CreatePageViewElement method of the custom CustomGridDetailViewCellElement class.

 protected override RadPageViewElement CreatePageViewElement(IRadPageViewProvider pageViewProvider)
 {
     RadPageViewElement pageViewElement = base.CreatePageViewElement(pageViewProvider);

     // Hide the dynamic header that shows the selected tab name
     if (pageViewElement is RadPageViewExplorerBarElement explorerBarElement)
     {
         // Hide the header completely
         explorerBarElement.Header.Visibility = ElementVisibility.Collapsed;

         // Alternative: Modify the header text instead of hiding
         // explorerBarElement.Header.Text = "Your Custom Header Text";
     }

     return pageViewElement;
 }

I've attached my test project to show this suggestion. Can you give it a try and let me know how it goes?

If this doesn't help, feel free to modify the project to recreate the troublesome behavior and send it over.

Carl
Top achievements
Rank 1
Bronze
Iron
Iron
commented on 20 Aug 2026, 06:48 PM | edited

Martin

Thanks for this. The demo was very helpful and the override took care of one part of the issue. My question now is how to get rid of the entire row that says HIDE ME in the UI below. This didn't do it:

ShowChildViewCaptions = false;

 

Martin Ivanov
Telerik team
commented on 28 Aug 2026, 01:20 PM

One way to hide these headers is to create a custom RadPageViewExplorerBarItem and override its MeasureOverride() method. I've attached an updated version of my project to show this suggestion. I hope it helps.
0
Dess
Top achievements
Rank 1
Iron
answered on 03 Sep 2026, 06:03 AM | edited on 03 Sep 2026, 06:08 AM

Hi, Carl,

To hide the caption ("HIDE ME") for each hierarchical template when using the ExplorerBar mode for the grid hierarchy, you need to subscribe to the ViewCellFormatting event before the grid is populated with data and manipulate the size of each RadPageViewExplorerBarItem. A sample code snippet is demonstrated below, and the result is illustrated as well:

        this.gvDrawerSummary.ViewCellFormatting += (sender, e) =>
        {
           GridDetailViewCellElement detailCell = e.CellElement as GridDetailViewCellElement;
            if (detailCell != null && detailCell.PageViewElement!=null)
            {
                for (int i = 0; i < detailCell.PageViewElement.Items.Count; i++)
                {
                    detailCell.PageViewElement.Items[i].Visibility = Telerik.WinControls.ElementVisibility.Hidden;
                    detailCell.PageViewElement.Items[i].MaxSize= new Size(1, 1);
                }
            }
        };

Before:

After:

I believe that this would fit the scenario you need to cover.

Carl
Top achievements
Rank 1
Bronze
Iron
Iron
commented on 03 Sep 2026, 12:56 PM

Thanks for this. I tried Martin Ivanov's approach last week and it worked perfectly!

Carl

Tags
GridView
Asked by
Carl
Top achievements
Rank 1
Bronze
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Dess
Top achievements
Rank 1
Iron
Share this question
or