Search code examples
ag-gridag-grid-react

How to not display single child row in ag-grid group row?


If a group row has only 1 child, it may be redundant to show the child row. Is there a way to hide single child row in a grouped ag-grid?


Solution

  • Yes! Ag-Grid provides this feature. Just set groupRemoveSingleChildren=true in your grid options. This removes groups from display if they only have one child.

    Official docs here - https://ag-grid.com/javascript-data-grid/grouping-single-group-column/#removing-single-children