You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, the grid is set to merge only when columns are sorted, and both Category and Product columns are configured for merging.
62
79
63
80
## Custom Merge Conditions
64
81
In addition to the built-in `always` and `onSort` modes, the grid allows you to define a custom condition for merging cells through the `mergeStrategy` property. This strategy controls both how cells are compared and how merged ranges are calculated.
65
82
66
83
### Merge Strategy Class
67
-
A custom merge strategy must implement the `IgrGridMergeStrategy` class:
84
+
A custom merge strategy must implement the `GridMergeStrategy` class:
68
85
86
+
<!-- React -->
69
87
```ts
70
88
exportdeclareclassIgrGridMergeStrategy {
71
89
merge: (
@@ -80,14 +98,33 @@ export declare class IgrGridMergeStrategy {
-`comparer` - defines the condition to decide if two adjacent records should be merged.
85
121
86
122
<!-- ComponentStart: Grid, HierarchicalGrid -->
87
123
### Extending the Default Strategy
88
124
89
-
If you only want to customize part of the behavior (for example, the comparer logic), you can extend the built-in `IgrDefaultMergeStrategy` and override the relevant methods.
125
+
If you only want to customize part of the behavior (for example, the comparer logic), you can extend the built-in `DefaultMergeStrategy` and override the relevant methods.
The `IgxTreeGrid` provides two built-in strategies that implement the `IGridMergeStrategy` interface: `DefaultTreeGridMergeStrategy` and `ByLevelTreeGridMergeStrategy`. `DefaultTreeGridMergeStrategy` merges all cells with the same value, regardless of their hierarchical level. In contrast, `ByLevelTreeGridMergeStrategy` only merges cells if they have the same value and are located at the same level, making level a required condition for merging.
@@ -108,6 +160,7 @@ The `IgxTreeGrid` provides two built-in strategies that implement the `IGridMerg
108
160
109
161
If you only want to customize part of the behavior (for example, the comparer logic), you can extend one of the built-in strategies, either `DefaultTreeGridMergeStrategy` or `ByLevelTreeGridMergeStrategy`, and override the relevant methods.
0 commit comments