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

Grid detail does not remain collapsed after page change

1 Answer 16 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Oscar
Top achievements
Rank 1
Oscar asked on 27 Oct 2020, 06:37 PM

Hello everyone,

I'm having an issue with expanded grid details. I have a collapseAll method with a forEach inside that iterates every item that loads in my grid and uses collapseRow to close them on load.

Now this works for page 1, but if I move to page 2 and decide to expand any details , then I switch back to page 1 and return to 2, the grid details remain expanded when they should collapse since I have a call to collapseAll on pageLoad method. Is there some index issue that fails to capture indexes outside of page1?

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 29 Oct 2020, 12:20 PM

Hi Oscar,

I am not sure what is the exact implementation on your side. But as long as the functionality is as expected for the first page and not for the other pages, then it seems that the collapseRow() method is used improperly. Probably you are passing some incorrect indexes to it. Generally, the row index depends on the absolute index of the item on the page, the pageSize and the current page. For example the index of the third row on the first page when using a pageSize of 10 would be 2 and the index of the third row on the second page when using a pageSize of 10 would be 12.

We have also provided the ExpandDetailsDirective which controls the expanded state of the master details Grids. Please check it at the followin link:

https://www.telerik.com/kendo-angular-ui/components/grid/api/ExpandDetailsDirective/

I hope the provided information helps.

Regards,
Svetlin
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
Oscar
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or