This is a migrated thread and some comments may be shown as answers.

Add an expand All or collapse all button to the parent header

4 Answers 100 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pramod
Top achievements
Rank 1
Pramod asked on 10 Apr 2013, 02:34 PM
 I have a basic HierarchyChildTemplate grid with parent and hild relation ship defined and the grid works fine. One of the requirements it to add a plus button in the header for the first column when clicked by the user it has to expand all the rows with row details  and collpase when clicked again just like it would behave for each row. 

I was able to add a button and expand the rows details successfully  but I need the button to show up in the row header.

Any help in this regards is appreciated 

Thank you 

4 Answers, 1 is accepted

Sort by
0
Dinesh
Top achievements
Rank 1
answered on 15 Mar 2019, 04:49 AM
Expand & Collapse Row Details in HierarchyChildTemplate
My requirement all row using a single button is exapand and collapse, 

every time user expand the (+) button for all the grid, but user wants some extra button for expanding all the Hierarchial grids like this image.... 
0
Dinesh
Top achievements
Rank 1
answered on 15 Mar 2019, 04:51 AM
Anyone Give this requirement Answer ,..Specifically Telerik Admin 
0
Dinesh
Top achievements
Rank 1
answered on 15 Mar 2019, 04:52 AM
Anyone Tell the this Requirement Answer specifically Telerik Admin  
0
Dilyan Traykov
Telerik team
answered on 19 Mar 2019, 01:58 PM
Hello Dinesh,

The desired result can be achieved by adding a GridViewToggleButton to the PART_HierarchyIndentPresenter element of the GridViewHeaderRow template. Please have a look at the following article for details on how to extract and modify the control template of a control.

You can then handle the Checked and Unchecked events of the button, possibly by defining an attached behavior for it and call the ExpandAllHierarchyItems and CollapseAllHierarchyItems methods respectively.

For your convenience, I've also attached a sample project demonstrating this approach.

Please have a look and let me know whether a similar approach would be applicable at your end.

Regards,
Dilyan Traykov
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Pramod
Top achievements
Rank 1
Answers by
Dinesh
Top achievements
Rank 1
Dilyan Traykov
Telerik team
Share this question
or