Kendo MVC Grid - Expand/Collapse selected Master Row only

1 Answer 13 Views
Grid
george
Top achievements
Rank 1
george asked on 20 Nov 2022, 04:09 AM | edited on 20 Nov 2022, 04:12 AM

Hi ,

we are using kendo grid for asp.net mvc. It has multiple rows with button for expand (Each having separate detail rows).  Now when i click on each header (master row) row expand button it will display all detail rows below it and last row is a button saying 'Add Respondent' which will open a search window and pickup a row and it gets added to the bottom of the child rows.    Now the question is i want to hide any  previously expanded master rows EXCEPT this master row (along with child rows)  i expanded and the newly added child row should be displayed along with other children of the expanded master row.

see below when click on 'Add Respondent' it will add a new child row, to the list, but only this detail list should stay in expanded and upper detail list/grid should be collapsed  ( if any other detailed child rows)

 

1 Answer, 1 is accepted

Sort by
0
Anton Mironov
Telerik team
answered on 23 Nov 2022, 09:51 AM

Hi George,

Thank you for the image and the details provided.

In order to achieve the desired behavior, I would recommend using the "collapseRow" method. The approach of collapsing all rows is represented in the following article:

Before collapsing all the rows - get the instance of the current master row and skip it, or reexpand it with the help of the "expandRow" method.

Give a try to the approach above and let me know if further assistance is needed.

Kind Regards,
Anton Mironov
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/.

Tags
Grid
Asked by
george
Top achievements
Rank 1
Answers by
Anton Mironov
Telerik team
Share this question
or