expand and collapse of all rows in master grid

1 Answer 133 Views
Grid
seenu
Top achievements
Rank 2
Iron
Iron
Iron
seenu asked on 12 Jan 2022, 10:48 AM

Hi Team,

I have implemented master grid using this example: https://www.telerik.com/kendo-react-ui/components/grid/rows/hierarchy/

all works fine as expected. Now, i wanted achieve functionality of expand and collapse of all rows on click of a button. may i know how to achieve and do you have any specific example?

Regards,
M.Seenuvasan

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 12 Jan 2022, 11:23 AM

Hello, Seenuvasan,

The expanded/collapsed state of the detail/child Grid is part of the data. If they have to be expanded by default then we have to loop through the data initially and set the expanded property of each data records to true.

I made an example showcasing this:

https://stackblitz.com/edit/react-b5zocr-ah8atc?file=index.html

I hope this is helpful.

Regards,
Stefan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

seenu
Top achievements
Rank 2
Iron
Iron
Iron
commented on 13 Jan 2022, 04:59 PM

thank you Stefan for your quick reply. 

mine is grid inside another grid and i am populating data on click of expand icon using details component. is there specific example around?

seenu
Top achievements
Rank 2
Iron
Iron
Iron
commented on 13 Jan 2022, 05:07 PM

found a way to do that. give me couple of days and i will do and let you know incase any question
seenu
Top achievements
Rank 2
Iron
Iron
Iron
commented on 19 Jan 2022, 06:16 AM

got it working using the sample provided. thank you Stefan
Tags
Grid
Asked by
seenu
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Stefan
Telerik team
Share this question
or