Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
590
Facing issue while Collapse and Expand grouping.
posted

Hi

I want a small clarification on one of the use case related to IgrDataGrid (https://es.infragistics.com/products/ignite-ui-react/react/components/grids/data-grid/overview).

We have applied the initialGroupDescriptions on the IgrDataGrid, and as we can see in the below screen shot we have added one Button Collapse/Expand All. So we want that All the grouping should Collapse or Expand by clicking on that button.

So, for this I need to know how can we achieve that , If there is any solution for this please suggest  as I need to implement this in my IgrDataGrid.   

Hoping for a positive response.

Thanks!!!

Parents
No Data
Reply
  • 34810
    Offline posted

    Hello Shubham,

    I have been investigating into the behavior you are looking to achieve in this case, and at the moment there does not exist a method to collapse / expand all of the group descriptions. As a workaround to this though, something you can do is remove the IgrColumnGroupDescription from the IgrDataGrid.groupDescriptions collection and set the isGroupExpandedDefault property on the grid to whether or not you want all of the groups to be expanded or not and then re-add the IgrColumnGroupDescription.

    For example, assuming that you already had the “peopleGroup” set up in this case, the code for this could look something like the following to collapse all groups:

            this.grid.groupDescriptions.clear();
            this.grid.isGroupExpandedDefault = false;

            const peopleGroup = new IgrColumnGroupDescription();
            peopleGroup.field = "Country";
            peopleGroup.displayName = "Country";
            this.grid.groupDescriptions.add(peopleGroup);

    If you would like to see a method potentially implemented in the IgrDataGrid that allows you to expand all or collapse all groups, I would recommend suggesting a new product idea for this at our Ignite UI for React GitHub page, here: https://github.com/igniteui/igniteui-react/issues. This will place you in direct communication with our product management teams who plan and prioritize upcoming features and development based on community and user feedback.

    Please let me know if you have any other questions or concerns on this matter.

Children
No Data