igniteui-angular 21.1.0-rc.4 → 21.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/README.md +29 -0
  2. package/fesm2022/igniteui-angular-grids-core.mjs +5 -3
  3. package/fesm2022/igniteui-angular-grids-core.mjs.map +1 -1
  4. package/fesm2022/igniteui-angular-grids-grid.mjs +6 -1
  5. package/fesm2022/igniteui-angular-grids-grid.mjs.map +1 -1
  6. package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs +1 -0
  7. package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs.map +1 -1
  8. package/fesm2022/igniteui-angular-grids-lite.mjs +2 -0
  9. package/fesm2022/igniteui-angular-grids-lite.mjs.map +1 -1
  10. package/fesm2022/igniteui-angular-simple-combo.mjs +1 -1
  11. package/fesm2022/igniteui-angular-simple-combo.mjs.map +1 -1
  12. package/lib/core/styles/components/grid/_grid-theme.scss +4 -1
  13. package/migrations/migration-collection.json +7 -0
  14. package/migrations/update-21_1_0_add-agent-skills/index.d.ts +3 -0
  15. package/migrations/update-21_1_0_add-agent-skills/index.js +46 -0
  16. package/package.json +4 -4
  17. package/skills/igniteui-angular-components/SKILL.md +71 -0
  18. package/skills/igniteui-angular-components/references/charts.md +447 -0
  19. package/skills/igniteui-angular-components/references/data-display.md +347 -0
  20. package/skills/igniteui-angular-components/references/directives.md +149 -0
  21. package/skills/igniteui-angular-components/references/feedback.md +141 -0
  22. package/skills/igniteui-angular-components/references/form-controls.md +298 -0
  23. package/skills/igniteui-angular-components/references/layout-manager.md +415 -0
  24. package/skills/igniteui-angular-components/references/layout.md +216 -0
  25. package/skills/igniteui-angular-components/references/setup.md +157 -0
  26. package/skills/igniteui-angular-grids/SKILL.md +110 -0
  27. package/skills/igniteui-angular-grids/references/data-operations.md +436 -0
  28. package/skills/igniteui-angular-grids/references/editing.md +480 -0
  29. package/skills/igniteui-angular-grids/references/features.md +218 -0
  30. package/skills/igniteui-angular-grids/references/paging-remote.md +388 -0
  31. package/skills/igniteui-angular-grids/references/state.md +448 -0
  32. package/skills/igniteui-angular-grids/references/structure.md +290 -0
  33. package/skills/igniteui-angular-grids/references/types.md +428 -0
  34. package/skills/igniteui-angular-theming/SKILL.md +530 -0
  35. package/styles/igniteui-angular-dark.css +1 -1
  36. package/styles/igniteui-angular.css +1 -1
  37. package/styles/igniteui-bootstrap-dark.css +1 -1
  38. package/styles/igniteui-bootstrap-light.css +1 -1
  39. package/styles/igniteui-dark-green.css +1 -1
  40. package/styles/igniteui-fluent-dark-excel.css +1 -1
  41. package/styles/igniteui-fluent-dark-word.css +1 -1
  42. package/styles/igniteui-fluent-dark.css +1 -1
  43. package/styles/igniteui-fluent-light-excel.css +1 -1
  44. package/styles/igniteui-fluent-light-word.css +1 -1
  45. package/styles/igniteui-fluent-light.css +1 -1
  46. package/styles/igniteui-indigo-dark.css +1 -1
  47. package/styles/igniteui-indigo-light.css +1 -1
  48. package/styles/maps/igniteui-angular-dark.css.map +1 -1
  49. package/styles/maps/igniteui-angular.css.map +1 -1
  50. package/styles/maps/igniteui-bootstrap-dark.css.map +1 -1
  51. package/styles/maps/igniteui-bootstrap-light.css.map +1 -1
  52. package/styles/maps/igniteui-dark-green.css.map +1 -1
  53. package/styles/maps/igniteui-fluent-dark-excel.css.map +1 -1
  54. package/styles/maps/igniteui-fluent-dark-word.css.map +1 -1
  55. package/styles/maps/igniteui-fluent-dark.css.map +1 -1
  56. package/styles/maps/igniteui-fluent-light-excel.css.map +1 -1
  57. package/styles/maps/igniteui-fluent-light-word.css.map +1 -1
  58. package/styles/maps/igniteui-fluent-light.css.map +1 -1
  59. package/styles/maps/igniteui-indigo-dark.css.map +1 -1
  60. package/styles/maps/igniteui-indigo-light.css.map +1 -1
  61. package/types/igniteui-angular-grids-lite.d.ts +2 -0
@@ -0,0 +1,436 @@
1
+ # Grid Data Operations — Sorting, Filtering & Grouping
2
+
3
+ > **Part of the [`igniteui-angular-grids`](../SKILL.md) skill hub.**
4
+ > For grid setup, column config — see [`structure.md`](./structure.md).
5
+ > For paging and remote data — see [`paging-remote.md`](./paging-remote.md).
6
+ > For editing and validation — see [`editing.md`](./editing.md).
7
+ > For state persistence — see [`state.md`](./state.md).
8
+
9
+ ## Accessing the Grid Instance
10
+
11
+ All programmatic data operations require a reference to the grid component. Use `viewChild` with the **correct component type** for your grid.
12
+
13
+ > **AGENT INSTRUCTION:** Check `package.json` to determine whether the project uses `igniteui-angular` or `@infragistics/igniteui-angular`. Replace the package prefix in every import accordingly. Always use specific entry points — never the root barrel of either package.
14
+
15
+ ```typescript
16
+ import { Component, ChangeDetectionStrategy, signal, viewChild } from '@angular/core';
17
+
18
+ // Open-source package — import from specific entry points
19
+ // Grid Lite (separate npm package — requires `npm install igniteui-grid-lite`)
20
+ import { IgxGridLiteComponent } from 'igniteui-angular/grids/lite';
21
+ // Flat Grid
22
+ import { IgxGridComponent, IGX_GRID_DIRECTIVES } from 'igniteui-angular/grids/grid';
23
+ // Tree Grid
24
+ import { IgxTreeGridComponent, IGX_TREE_GRID_DIRECTIVES } from 'igniteui-angular/grids/tree-grid';
25
+ // Hierarchical Grid
26
+ import { IgxHierarchicalGridComponent, IGX_HIERARCHICAL_GRID_DIRECTIVES } from 'igniteui-angular/grids/hierarchical-grid';
27
+ // Pivot Grid
28
+ import { IgxPivotGridComponent, IGX_PIVOT_GRID_DIRECTIVES } from 'igniteui-angular/grids/pivot-grid';
29
+
30
+ // Licensed package — same entry-point paths, different prefix:
31
+ // import { IgxGridComponent, IGX_GRID_DIRECTIVES } from '@infragistics/igniteui-angular/grids/grid';
32
+ // import { IgxTreeGridComponent, IGX_TREE_GRID_DIRECTIVES } from '@infragistics/igniteui-angular/grids/tree-grid';
33
+ // import { IgxHierarchicalGridComponent, IGX_HIERARCHICAL_GRID_DIRECTIVES } from '@infragistics/igniteui-angular/grids/hierarchical-grid';
34
+ // import { IgxPivotGridComponent, IGX_PIVOT_GRID_DIRECTIVES } from '@infragistics/igniteui-angular/grids/pivot-grid';
35
+
36
+ // AVOID — never import from the root barrel (wrong for BOTH variants)
37
+ // import { IgxGridComponent } from 'igniteui-angular';
38
+ // import { IgxGridComponent } from '@infragistics/igniteui-angular';
39
+ ```
40
+
41
+ ### Flat Grid Example
42
+
43
+ ```typescript
44
+ @Component({
45
+ selector: 'app-orders-grid',
46
+ imports: [IGX_GRID_DIRECTIVES],
47
+ templateUrl: './orders-grid.component.html',
48
+ changeDetection: ChangeDetectionStrategy.OnPush
49
+ })
50
+ export class OrdersGridComponent {
51
+ gridRef = viewChild.required<IgxGridComponent>('grid');
52
+ protected data = signal<Order[]>([]);
53
+
54
+ sortByName() {
55
+ this.gridRef().sort({ fieldName: 'name', dir: SortingDirection.Asc, ignoreCase: true });
56
+ }
57
+ }
58
+ ```
59
+
60
+ ### Tree Grid Example
61
+
62
+ ```typescript
63
+ @Component({
64
+ selector: 'app-org-tree',
65
+ imports: [IGX_TREE_GRID_DIRECTIVES],
66
+ templateUrl: './org-tree.component.html',
67
+ changeDetection: ChangeDetectionStrategy.OnPush
68
+ })
69
+ export class OrgTreeComponent {
70
+ // Use IgxTreeGridComponent for tree grids
71
+ treeGridRef = viewChild.required<IgxTreeGridComponent>('treeGrid');
72
+ protected employees = signal<Employee[]>([]);
73
+ }
74
+ ```
75
+
76
+ ```html
77
+ <igx-tree-grid #treeGrid
78
+ [data]="employees()"
79
+ primaryKey="id"
80
+ foreignKey="managerId"
81
+ height="600px">
82
+ <igx-column field="name" [sortable]="true" [filterable]="true"></igx-column>
83
+ </igx-tree-grid>
84
+ ```
85
+
86
+ ### Hierarchical Grid Example
87
+
88
+ ```typescript
89
+ @Component({
90
+ selector: 'app-company-grid',
91
+ imports: [IGX_HIERARCHICAL_GRID_DIRECTIVES],
92
+ templateUrl: './company-grid.component.html',
93
+ changeDetection: ChangeDetectionStrategy.OnPush
94
+ })
95
+ export class CompanyGridComponent {
96
+ // Use IgxHierarchicalGridComponent for hierarchical grids
97
+ hGridRef = viewChild.required<IgxHierarchicalGridComponent>('hGrid');
98
+ protected companies = signal<Company[]>([]);
99
+ }
100
+ ```
101
+
102
+ ```html
103
+ <igx-hierarchical-grid #hGrid
104
+ [data]="companies()"
105
+ primaryKey="id"
106
+ height="600px">
107
+ <igx-column field="name" [sortable]="true"></igx-column>
108
+ <igx-row-island key="orders" primaryKey="orderId">
109
+ <igx-column field="orderId" [sortable]="true"></igx-column>
110
+ </igx-row-island>
111
+ </igx-hierarchical-grid>
112
+ ```
113
+
114
+ > **CRITICAL**: Every programmatic example in this file uses Flat Grid (`IgxGridComponent`) by default. For Tree Grid substitute `IgxTreeGridComponent` and `#treeGrid`. For Hierarchical Grid substitute `IgxHierarchicalGridComponent` and `#hGrid`. The sorting, filtering, and editing APIs are either the same or very similar across all three grid types (Flat, Tree, Hierarchical). **Pivot Grid does NOT support standard sorting/filtering/editing APIs** — see [`state.md`](./state.md). **Grid Lite has its own lightweight sorting/filtering API** — see [`state.md`](./state.md).
115
+
116
+ ## Sorting
117
+
118
+ > **Docs:** [Sorting](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/sorting) · [Tree Grid](https://www.infragistics.com/products/ignite-ui-angular/angular/components/treegrid/sorting) · [Hierarchical Grid](https://www.infragistics.com/products/ignite-ui-angular/angular/components/hierarchicalgrid/sorting)
119
+
120
+ > **Applies to**: Flat Grid, Tree Grid, and Hierarchical Grid. Pivot Grid uses dimension-level sorting instead (see [`state.md`](./state.md)). **Grid Lite** uses a different sorting API — see [`state.md`](./state.md).
121
+ >
122
+ > **Tree Grid behavior**: sorting is applied per-level — children are sorted among their siblings, not globally flattened.
123
+ >
124
+ > **Hierarchical Grid behavior**: each grid level sorts independently. Configure sorting on the `<igx-row-island>` to apply to all child grids at that level.
125
+
126
+ ### Template-Driven Sorting
127
+
128
+ Enable sorting on individual columns and optionally bind the sorting state:
129
+
130
+ ```html
131
+ <igx-grid #grid
132
+ [data]="data()"
133
+ [(sortingExpressions)]="sortExprs"
134
+ [sortingOptions]="{ mode: 'single' }">
135
+ <igx-column field="name" [sortable]="true"></igx-column>
136
+ <igx-column field="date" dataType="date" [sortable]="true"></igx-column>
137
+ <igx-column field="amount" dataType="number" [sortable]="true"></igx-column>
138
+ </igx-grid>
139
+ ```
140
+
141
+ Sorting modes:
142
+ - `'multiple'` — multi-column sorting in order (default)
143
+ - `'single'` — only one column sorted at a time
144
+
145
+ ### Programmatic Sorting
146
+
147
+ ```typescript
148
+ import { SortingDirection } from 'igniteui-angular/core';
149
+ // import { SortingDirection } from '@infragistics/igniteui-angular/core'; for licensed package
150
+
151
+ // Sort a single column
152
+ this.gridRef().sort({ fieldName: 'name', dir: SortingDirection.Asc, ignoreCase: true });
153
+
154
+ // Sort multiple columns
155
+ this.gridRef().sort([
156
+ { fieldName: 'category', dir: SortingDirection.Asc, ignoreCase: true },
157
+ { fieldName: 'price', dir: SortingDirection.Desc, ignoreCase: false }
158
+ ]);
159
+
160
+ // Clear sorting on one column
161
+ this.gridRef().clearSort('name');
162
+
163
+ // Clear all sorting
164
+ this.gridRef().clearSort();
165
+ ```
166
+
167
+ ### Sorting Events
168
+
169
+ | Event | Cancelable | Payload |
170
+ |---|---|---|
171
+ | `(sorting)` | Yes | `ISortingEventArgs` — set `event.cancel = true` to prevent |
172
+ | `(sortingDone)` | No | `ISortingEventArgs` — fires after sort is applied |
173
+
174
+ ```typescript
175
+ onSorting(event: ISortingEventArgs) {
176
+ // Prevent sorting on a specific column
177
+ if (event.fieldName === 'id') {
178
+ event.cancel = true;
179
+ }
180
+ }
181
+
182
+ onSortingDone(event: ISortingEventArgs) {
183
+ console.log('Sorted by:', event.fieldName, event.dir);
184
+ // Good place to trigger remote data fetch
185
+ }
186
+ ```
187
+
188
+ ### Custom Sorting Strategy
189
+
190
+ Implement `ISortingStrategy` to control how values are compared:
191
+
192
+ ```typescript
193
+ import { ISortingStrategy, SortingDirection } from 'igniteui-angular/grids/core';
194
+
195
+ class PrioritySortStrategy implements ISortingStrategy {
196
+ private priorityOrder = ['Critical', 'High', 'Medium', 'Low'];
197
+
198
+ sort(data: any[], fieldName: string, dir: SortingDirection): any[] {
199
+ return data.sort((a, b) => {
200
+ const indexA = this.priorityOrder.indexOf(a[fieldName]);
201
+ const indexB = this.priorityOrder.indexOf(b[fieldName]);
202
+ return dir === SortingDirection.Asc ? indexA - indexB : indexB - indexA;
203
+ });
204
+ }
205
+ }
206
+ ```
207
+
208
+ ```html
209
+ <igx-column field="priority" [sortable]="true" [sortStrategy]="prioritySortStrategy"></igx-column>
210
+ ```
211
+
212
+ ## Filtering
213
+
214
+ > **Docs:** [Filtering](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/filtering) · [Excel-Style](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/excel-style-filtering) · [Advanced](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/advanced-filtering) (substitute URL prefix per grid type)
215
+
216
+ > **Applies to**: Flat Grid, Tree Grid, and Hierarchical Grid. Pivot Grid uses dimension-level filtering instead (see [`state.md`](./state.md)). **Grid Lite** uses a different filtering API — see [`state.md`](./state.md).
217
+ >
218
+ > **Tree Grid behavior**: filtering is **recursive** — when a child matches, all its ancestor rows are shown (even if they don't match) and auto-expanded.
219
+ >
220
+ > **Hierarchical Grid behavior**: each grid level filters independently. Configure filtering on the `<igx-row-island>` to apply to all child grids at that level.
221
+
222
+ ### Filter Modes
223
+
224
+ | Mode | Template Property | Description |
225
+ |---|---|---|
226
+ | Quick Filter | `[filterMode]="'quickFilter'"` | Row of filter inputs above columns |
227
+ | Excel-Style | `[filterMode]="'excelStyleFilter'"` | Excel-like dropdown menus per column |
228
+ | Advanced | `[allowAdvancedFiltering]="true"` | Dialog with complex filter tree (AND/OR groups) |
229
+
230
+ ```html
231
+ <!-- Excel-style filtering (most common enterprise pattern) -->
232
+ <igx-grid #grid
233
+ [data]="data()"
234
+ [allowFiltering]="true"
235
+ [filterMode]="'excelStyleFilter'">
236
+ <igx-column field="name" [filterable]="true"></igx-column>
237
+ <igx-column field="status" [filterable]="true"></igx-column>
238
+ <igx-column field="amount" dataType="number" [filterable]="true"></igx-column>
239
+ </igx-grid>
240
+ ```
241
+
242
+ ### Programmatic Filtering
243
+
244
+ ```typescript
245
+ import {
246
+ IgxStringFilteringOperand,
247
+ IgxNumberFilteringOperand,
248
+ IgxDateFilteringOperand,
249
+ IgxBooleanFilteringOperand,
250
+ FilteringExpressionsTree,
251
+ FilteringLogic
252
+ } from 'igniteui-angular/grids/core';
253
+
254
+ // Simple single-column filter
255
+ this.gridRef().filter('name', 'John', IgxStringFilteringOperand.instance().condition('contains'), true);
256
+
257
+ // Filter by number range
258
+ this.gridRef().filter('amount', 1000, IgxNumberFilteringOperand.instance().condition('greaterThan'));
259
+
260
+ // Filter by date
261
+ this.gridRef().filter('hireDate', new Date(2024, 0, 1), IgxDateFilteringOperand.instance().condition('after'));
262
+
263
+ // Clear single column filter
264
+ this.gridRef().clearFilter('name');
265
+
266
+ // Clear all filters
267
+ this.gridRef().clearFilter();
268
+ ```
269
+
270
+ ### Complex Filtering (AND/OR Groups)
271
+
272
+ Build multi-condition filters using `FilteringExpressionsTree`:
273
+
274
+ ```typescript
275
+ const tree = new FilteringExpressionsTree(FilteringLogic.And);
276
+ tree.filteringOperands = [
277
+ {
278
+ fieldName: 'status',
279
+ condition: IgxStringFilteringOperand.instance().condition('equals'),
280
+ searchVal: 'Active',
281
+ ignoreCase: true
282
+ },
283
+ {
284
+ fieldName: 'amount',
285
+ condition: IgxNumberFilteringOperand.instance().condition('greaterThan'),
286
+ searchVal: 500
287
+ }
288
+ ];
289
+ // Use filteringExpressionsTree for column-level programmatic filtering
290
+ this.gridRef().filteringExpressionsTree = tree;
291
+ this.gridRef().cdr.detectChanges();
292
+ ```
293
+
294
+ > **NOTE**: Use `filteringExpressionsTree` for programmatic column-level filtering. `advancedFilteringExpressionsTree` is only for the advanced filtering dialog (`[allowAdvancedFiltering]="true"`).
295
+
296
+ ### Global Filtering & Cross-Column Logic
297
+
298
+ ```typescript
299
+ // Filter all filterable columns at once with a search term
300
+ this.gridRef().filterGlobal('search term', IgxStringFilteringOperand.instance().condition('contains'), true);
301
+ ```
302
+
303
+ Control the AND/OR logic between **different column** filters:
304
+
305
+ ```html
306
+ <!-- Default is AND — all column filters must match. Use OR to match any column filter -->
307
+ <igx-grid #grid [data]="data()" [allowFiltering]="true" [filteringLogic]="filteringLogic">
308
+ </igx-grid>
309
+ ```
310
+
311
+ ```typescript
312
+ import { FilteringLogic } from 'igniteui-angular/grids/core';
313
+
314
+ // FilteringLogic.And (default) — row must match ALL column filters
315
+ // FilteringLogic.Or — row must match ANY column filter
316
+ filteringLogic = FilteringLogic.And;
317
+ ```
318
+
319
+ ### Filtering Events
320
+
321
+ | Event | Cancelable | Payload |
322
+ |---|---|---|
323
+ | `(filtering)` | Yes | `IFilteringEventArgs` — set `event.cancel = true` to prevent |
324
+ | `(filteringDone)` | No | `IFilteringEventArgs` — fires after a **column-level** filter is applied |
325
+ | `(filteringExpressionsTreeChange)` | No | `IFilteringExpressionsTree` — fires after the **grid-level** filter tree changes (use this for remote data) |
326
+
327
+ ```typescript
328
+ onFilteringDone(event: IFilteringEventArgs) {
329
+ // Trigger remote data fetch with new filter state
330
+ this.loadFilteredData();
331
+ }
332
+ ```
333
+
334
+ > **Remote data note:** For remote filtering, subscribe to `(filteringExpressionsTreeChange)` instead of `(filteringDone)`. The former reflects the complete grid-level filter tree, including "clear all filters" — `filteringDone` is column-scoped and can miss global state changes.
335
+
336
+ ### Available Filtering Operands by Data Type
337
+
338
+ | Operand Class | Conditions |
339
+ |---|---|
340
+ | `IgxStringFilteringOperand` | `contains`, `startsWith`, `endsWith`, `equals`, `doesNotEqual`, `doesNotContain`, `empty`, `notEmpty`, `null`, `notNull`, `in` |
341
+ | `IgxNumberFilteringOperand` | `equals`, `doesNotEqual`, `greaterThan`, `lessThan`, `greaterThanOrEqualTo`, `lessThanOrEqualTo`, `empty`, `notEmpty`, `null`, `notNull`, `in` |
342
+ | `IgxDateFilteringOperand` | `equals`, `doesNotEqual`, `before`, `after`, `today`, `yesterday`, `thisMonth`, `lastMonth`, `nextMonth`, `thisYear`, `lastYear`, `nextYear`, `empty`, `notEmpty`, `null`, `notNull`, `in` |
343
+ | `IgxBooleanFilteringOperand` | `all`, `true`, `false`, `empty`, `notEmpty`, `null`, `notNull` |
344
+
345
+ ## Grouping (Flat Grid Only)
346
+
347
+ > **Docs:** [Group By](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/groupby)
348
+
349
+ > **NOTE**: GroupBy is **exclusive to the Flat Grid** (`igx-grid`). Tree Grid uses its natural hierarchy. Hierarchical Grid uses row islands. Pivot Grid uses dimensions.
350
+
351
+ ### Template-Driven Grouping
352
+
353
+ ```html
354
+ <igx-grid #grid
355
+ [data]="data()"
356
+ [groupsExpanded]="true">
357
+ <igx-column field="category" [groupable]="true"></igx-column>
358
+ <igx-column field="product" [groupable]="true"></igx-column>
359
+ <igx-column field="price" dataType="number"></igx-column>
360
+
361
+ <!-- Custom group row template -->
362
+ <ng-template igxGroupByRow let-groupRow>
363
+ {{ groupRow.expression.fieldName }}: {{ groupRow.value }}
364
+ ({{ groupRow.records.length }} items)
365
+ </ng-template>
366
+ </igx-grid>
367
+ ```
368
+
369
+ ### Programmatic Grouping
370
+
371
+ ```typescript
372
+ import { SortingDirection } from 'igniteui-angular/grids/core';
373
+
374
+ // Group by a column
375
+ this.gridRef().groupBy({ fieldName: 'category', dir: SortingDirection.Asc, ignoreCase: true });
376
+
377
+ // Group by multiple columns
378
+ this.gridRef().groupBy([
379
+ { fieldName: 'region', dir: SortingDirection.Asc, ignoreCase: true },
380
+ { fieldName: 'category', dir: SortingDirection.Asc, ignoreCase: true }
381
+ ]);
382
+
383
+ // Clear grouping on one column
384
+ this.gridRef().clearGrouping('category');
385
+
386
+ // Clear all grouping
387
+ this.gridRef().clearGrouping();
388
+
389
+ // Toggle group row expansion
390
+ this.gridRef().toggleGroup(groupRow);
391
+
392
+ // Expand/collapse all groups
393
+ this.gridRef().toggleAllGroupRows();
394
+ ```
395
+
396
+ ### Group By Events
397
+
398
+ | Event | Description |
399
+ |---|---|
400
+ | `(groupingDone)` | Fires after grouping expressions change |
401
+
402
+ ### Custom Group-By Key
403
+
404
+ Control how values are grouped using a `groupingComparer`:
405
+
406
+ ```typescript
407
+ // Group dates by month instead of exact value
408
+ const monthGroupComparer = (a: Date, b: Date) => {
409
+ return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() ? 0 : -1;
410
+ };
411
+ ```
412
+
413
+ ```html
414
+ <igx-column field="orderDate" dataType="date" [groupable]="true" [groupingComparer]="monthGroupComparer"></igx-column>
415
+ ```
416
+
417
+ ## Key Rules
418
+
419
+ 1. **Use the correct component type for `viewChild`** — `IgxGridLiteComponent`, `IgxGridComponent`, `IgxTreeGridComponent`, `IgxHierarchicalGridComponent`, or `IgxPivotGridComponent`
420
+ 2. **Import the correct directives/components** — `IGX_GRID_DIRECTIVES`, `IGX_TREE_GRID_DIRECTIVES`, `IGX_HIERARCHICAL_GRID_DIRECTIVES`, `IGX_PIVOT_GRID_DIRECTIVES`, or individual Grid Lite imports (with `CUSTOM_ELEMENTS_SCHEMA`)
421
+ 3. **Set `dataType` on every column** — enables correct filtering operands, sorting behavior, and editors
422
+ 4. **Cancelable events** — use `event.cancel = true` in `(sorting)`, `(filtering)` to prevent the action
423
+ 5. **Use signals for data** — `[data]="myData()"` with `signal<T[]>([])`
424
+ 6. **GroupBy is Flat Grid only** — Tree Grid uses hierarchy, Hierarchical Grid uses row islands, Pivot Grid uses dimensions
425
+ 7. **Tree Grid filtering is recursive** — parents of matching children are always shown and auto-expanded
426
+ 8. **Hierarchical Grid levels are independent** — sorting/filtering don't cascade; configure on `<igx-row-island>`
427
+ 9. **Use `filteringExpressionsTree` for programmatic filtering** — `advancedFilteringExpressionsTree` is only for the advanced filtering dialog
428
+
429
+ ## See Also
430
+
431
+ - [`paging-remote.md`](./paging-remote.md) — Paging, remote data operations, virtualization, multi-grid coordination
432
+ - [`editing.md`](./editing.md) — Cell editing, row editing, batch editing, validation, summaries
433
+ - [`state.md`](./state.md) — State persistence, Tree Grid / Hierarchical Grid / Pivot Grid / Grid Lite data operations
434
+ - [`structure.md`](./structure.md) — Grid structure, column configuration, templates, layout, selection
435
+ - [`../../igniteui-angular-components/SKILL.md`](../../igniteui-angular-components/SKILL.md) — Non-grid Ignite UI components
436
+ - [`../../igniteui-angular-theming/SKILL.md`](../../igniteui-angular-theming/SKILL.md) — Theming & Styling