diff --git a/src/app/grid/grid-row-reorder-sample/grid-row-reorder.ts b/src/app/grid/grid-row-reorder-sample/grid-row-reorder.ts index 29070b8ed..7f32d7fd0 100644 --- a/src/app/grid/grid-row-reorder-sample/grid-row-reorder.ts +++ b/src/app/grid/grid-row-reorder-sample/grid-row-reorder.ts @@ -25,9 +25,9 @@ export class GridRowReorderComponent { const currRowIndex = this.getCurrentRowIndex(this.grid.rowList.toArray(), { x: event.clientX, y: event.clientY }); if (currRowIndex === -1) { return; } - // remove the row that was dragged and place it onto its new location - this.grid.deleteRow(args.dragData.key); - this.data.splice(currRowIndex, 0, args.dragData.data); + const newData = this.data.filter(r => r.ID !== args.dragData.key); + newData.splice(currRowIndex, 0, args.dragData.data); + this.data = newData; } private getCurrentRowIndex(rowList: IgxRowDirective[], cursorPosition) {