We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Enable Persistence of Expanded/Collapsed Groups

Hi,
I have two questions:
Is it possible to keep the collpased groups of a grid still collpased after a Refresh of the grid?
Is it possible to get and set the expanded and collapsed groups?

8 Replies

VN Vignesh Natarajan Syncfusion Team October 2, 2019 11:18 AM UTC

Hi Elio,  
 
Greetings from Syncfusion support.  
 
Query1: “Is it possible to keep the hidden groups of a grid still hidden after a Refresh of the grid? 
 
Yes. We suggest you to achieve your requirement using GroupCollapseAll() method of EjsGrid in the DataBound event.  Refer the below code example.  
 
<EjsGrid @ref="Grid" DataSource="@Orders" AllowGrouping="true" Height="400"> 
    <GridEvents DataBound="OnDataBound" TValue="Order"></GridEvents> 
    <GridGroupSettings Columns="@(new string[] {"CustomerID"})"></GridGroupSettings> 
. .  .  . . . . . . . . . . . 
</EjsGrid> 
 
@code{ 
        EjsGrid<Order> Grid; 
    public bool IntialRender = true; 
    public List<Order> Orders { get; set; } 
    public void OnDataBound() 
    { 
        if (!IntialRender) 
        { 
            Grid.GroupCollapseAll();   
            IntialRender = true; 
        }         
    } 
…… …. . . . . .  . 
} 
 
Refer the below sample for your reference 
 
 
Refer our API documentation for your reference 
 
 
Query2: “Is it possible to get and set the expanded and collapsed groups? 
 
Currently we do not have support to get or set the state of Grouped columns in Blazor Grid.  We are validating your requirement,so we will update you the further details on 4th October 2019. Till then we appreciate your patience. 
 
Regards, 
Vignesh Natarajan. 



EL Elio October 2, 2019 12:37 PM UTC

Hi,
Thank you for the reply. 
The issue is that using Grid.GroupCollapseAll();    it collapse all the groups. 
Instead I'd like to have with a grid.Refresh the collapsed groups stay collapsed and showed ones stay showed.
Actually I'm not at home so I can't upload a sample. I'll upload it asap. 


VN Vignesh Natarajan Syncfusion Team October 3, 2019 01:20 PM UTC

Hi Elio,  

Query: “The issue is that using Grid.GroupCollapseAll();    it collapse all the groups.  && Instead I'd like to have with a grid.Refresh the collapsed groups stay collapsed and showed ones stay showed. 

While refreshing the EjsGrid using Refresh() method, we will re-render the each cell inside the Grid or group with updated properties. So it is not possible to store the collapsed state and expanded state of the groups. Once refreshed either you can expand all the Group using GroupExpandAll() or collapse all the Group using GroupCollapseAll() methods. It is the default behavior of the Grid.  

Regards, 
Vignesh Natarajan. 



NS Nico Sänger October 18, 2021 08:04 AM UTC

Hello,


I am just curious, are there any plans on adding persistent grouping in the future, as without presistance across actions (paging, sorting, reload async data, etc.), the grouping feature is kinda useless if you want to display and group any amount of data.


At the moment I am looking into a js-bypass to show/hide groups manually with a selfmanaged list of all active groups whioch is absolutely hacky and deeply relies on classes being set, which is bound to break on any update.


Please take another look into grouping persistance.



Kind regards,



VN Vignesh Natarajan Syncfusion Team October 19, 2021 05:19 AM UTC

Hi Nico,  
 
Thanks for contacting Syncfusion support.  
 
Query: “Are there any plans on adding persistent grouping in the future, as without presistance across actions (paging, sorting, reload async data, etc.), the grouping feature is kinda useless 
 
We understand you are requirement to persist the expand / collapse of the Group while perform the data operations like paging, sorting etc. But as mentioned in the previous update during the data operation, we will re render all the cell inside the Grid with updated properties. (i.e.) when sorting is applied, all the record in Grid will be refreshed and displayed based on updated data. During this action entire Grid data and Grid will be refreshed.  
 
Hence it is not possible to maintain the expand/collapsed state of Grid grouping. Workaround also not feasible because involves a JavaScript interaction to find the list of groups in expanded state and same needs to applied after specific operation is completed. Performance of Grid will be affected while handling these actions in Grid with javascript interop.    
 
Hence we are not able to achieve this requirement. Please get back to us if you have further queries.  
 
Regards,
Vignesh Natarajan 
 
 



RM Riley McLaughlin replied to Vignesh Natarajan October 21, 2021 12:43 AM UTC

Why can't Synfusion just store an IsExpanded field on each row and then use that for expansion / collapsing each time there is a re-render, perhaps if some PersistDetailExpansion property is set to true? I am trying to implement that using events on my end, so if I can do it syncfusion should surely be able to implement it internally. I think we need a better explanation for why it's not feasible beyond that that's the way it already is. The grid is able to enable persistence for column order, sorting and etc, so why not row collapse state?

The state of the TreeGrid component is very unusable so DataGrid with detail view is the next best solution and I don't think we should accept that so many major functionalities are missing or that we need to hack into the event system for basic functions.

Thank you



JP Jeevakanth Palaniappan Syncfusion Team October 21, 2021 02:43 PM UTC

Hi Riley, 
 
We have forwarded your query to the corresponding development team. So we will update the further details in two business days. Until then we appreciate your patience. 
 
Regards, 
Jeevakanth SP. 



VN Vignesh Natarajan Syncfusion Team October 26, 2021 10:30 AM UTC

Hi Riley,  
 
Thanks for the patience. 
 
We have analyzed your suggestion and as currently we do not have support to achieve your requirement. We have considered it as a new improvement feature and logged the feature report for the same. Thank you for taking the time to request this feature “Support to maintain expand/collapse state of Groups in Grid during certain action ” and helping us improve our product. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. 
 
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.        
    
 
We do not have immediate plan to implement this feature and it will be included in any of our upcoming releases. Please cast your vote to make it count. So that we will prioritize the features for every release based on demands. Please let us know if you have any concerns.   
 
Regards, 
Vignesh Natarajan 
 
 


Loader.
Live Chat Icon For mobile
Up arrow icon