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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Enable Persistence of Expanded/Collapsed Groups

Thread ID:

Created:

Updated:

Platform:

Replies:

148011 Oct 1,2019 09:56 PM UTC Oct 3,2019 01:20 PM UTC Blazor 3
loading
Tags: Grid
Elio
Asked On October 2, 2019 07:14 AM UTC

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?

Vignesh Natarajan [Syncfusion]
Replied On 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. 


Elio
Replied On 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. 

Vignesh Natarajan [Syncfusion]
Replied On 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. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon