Display ModesOpen
Choose group heading alignment and manage grouping fields and their order.
Choose how nested group headings are aligned, and let users manage grouping from the grid toolbar.
Standard indents each grouping level. Compact aligns group headings to save horizontal space. Both preserve the same hierarchy, sorting and expand/collapse behavior.
The following example demonstrates the Group field picker, removable grouping chips and the three-dot menu for moving a grouping level earlier or later.
Loading grouping example…
Set displayMode and showGroupButton on groupable. The default remains standard display with the existing drag panel.
<ngb-datagrid
[columns]="columns"
[data]="rows"
[groupable]="{ displayMode: 'compact', showGroupButton: true }"
[group]="groups"
(groupChange)="groups = $event.group"
[dataOperations]="true">
</ngb-datagrid>
Use groupChange to retain the selected order. For remote data, load once from dataStateChange; each add, remove or move resets to page one. Applications can also call moveGroupField(field, 'previous' | 'next').
Tab to Group or a chip's actions button and press Enter or Space. In the open list, use Up/Down or Home/End to move between available actions. Escape closes the list and returns focus. First and last grouping levels disable unavailable moves.
Display mode changes presentation only; it is separate from row density and is not stored in saved views. Group descriptors retain their direction and aggregates when moved. The picker lists visible configured fields. Existing requirements for remote grouped data, virtualization and custom templates still apply.
Move between the overview, display modes, templates, aggregates, and sticky grouped row guides without losing context.
Start with local and manual grouping, shared state, and the base grouped grid flow.
Choose group heading alignment and manage grouping fields and their order.
Customize grouped headers, grouped cells, and grouped footer rows with public directives.
Add grouped totals, counts, averages, and min or max values to real grouped rows.
Keep grouped context pinned while scrolling through large grouped result sets.