1

I have a telerik RadGridView with a HierarchyChildTemplate to show a child grid when expanded. Now I would like to have only one item expanded at the same time. How should this be done? I can find options for WinForms but not for use in WPF.

I am using the HierarchyChildTemplate to show the grid as explained here

I tried implementing the "RowIsExpandedChanging" event, but don't know exactly what to do from there. I can do:

private void RowIsExpandedChanging_EventHandler(RowCancelEventArgs eventArgs)
    {            
        eventArgs.Row.GridViewDataControl.CollapseAllHierarchyItems();            
    }

But this will cause a stack overflow because it will recursively call itself.

Any help is appreciated!

nldev
  • 299
  • 3
  • 15
  • How do you expand the items, i.e. why and how are you expanding more than one item at the same time? – mm8 Oct 15 '18 at 13:29
  • Using the HierarchyChildTemplate as explained here: https://docs.telerik.com/devtools/wpf/controls/radgridview/hierarchical-gridview/how-to/access-child-gridview – nldev Oct 16 '18 at 07:18

1 Answers1

1

I assume, you have

<telerik:GridViewToggleRowDetailsColumn> 

As this is functional column for RadGridView, which displays "+" or "-". If so, set it property:

ExpandMode="Single"
Vanghern
  • 202
  • 1
  • 12