Skip to content

Commit 97d55d0

Browse files
authored
Merge pull request #1900 from IgniteUI/mkirova/fix-1856
fix(igxGrid): The forbidden operation indicator is not shown when attempting to group by a column by which grouping is already performed.
2 parents 0ac9367 + ab89274 commit 97d55d0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

projects/igniteui-angular/src/lib/grid/grid.common.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,8 @@ export class IgxGroupAreaDropDirective extends IgxDropDirective {
526526
public onDragEnter(event) {
527527
const drag: IgxColumnMovingDragDirective = event.detail.owner;
528528
const column: IgxColumnComponent = drag.column;
529-
if (column.groupable) {
529+
const isGrouped = column.grid.groupingExpressions.findIndex((item) => item.fieldName === column.field) !== -1;
530+
if (column.groupable && !isGrouped) {
530531
drag.icon.innerText = 'group_work';
531532
this.hovered = true;
532533
} else {
@@ -544,7 +545,8 @@ export class IgxGroupAreaDropDirective extends IgxDropDirective {
544545
const drag: IgxColumnMovingDragDirective = event.detail.owner;
545546
if (drag instanceof IgxColumnMovingDragDirective) {
546547
const column: IgxColumnComponent = drag.column;
547-
if (column.groupable) {
548+
const isGrouped = column.grid.groupingExpressions.findIndex((item) => item.fieldName === column.field) !== -1;
549+
if (column.groupable && !isGrouped) {
548550
column.grid.groupBy({ fieldName: column.field, dir: SortingDirection.Asc, ignoreCase: column.sortingIgnoreCase });
549551
}
550552
}

0 commit comments

Comments
 (0)