Kendo grid grouping expand unexpectedly when columns virtualization is on

1 Answer 196 Views
Grid
Nick
Top achievements
Rank 1
Iron
Nick asked on 20 Oct 2022, 04:54 PM

When columns virtualization is activated, grouping rows automatically expand (if collapsed), when scrolling the grid content.

Using this JsFiddle, try to scroll the grid vertically to reproduce the bug.

1 Answer, 1 is accepted

Sort by
0
Georgi Denchev
Telerik team
answered on 25 Oct 2022, 07:56 AM

Hello, Nick,

Thank you for the provided demo.

This behavior is expected as the Grid will rebind when new columns are loaded as you keep scrolling. Currently, the collapseGroup method is called once when the Grid initializes. However, when the Grid is re-bound, the groups will re-expand again.

You can use the dataBound event to collapse the group any time the grid is rebound.

          dataBound: function() {
            let grid = $("#grid").data("kendoGrid");
            grid.collapseGroup(".k-grouping-row");
          }

You can also extend the logic a bit and detect if the user has manually expanded the group. If they have, then stop collapsing it programmatically.

Best Regards,
Georgi Denchev
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
Nick
Top achievements
Rank 1
Iron
Answers by
Georgi Denchev
Telerik team
Share this question
or