Grid Batch Editing and Transactions

The Batch Editing feature of the igxGrid is based on the TransactionService. Follow the Transaction Service class hierarchy topic to see an overview of the igxTransactionService and details how it is implemented.

Below is a detailed example of how is Batch Editing enabled for the igxGrid component.


The following sample demonstrates a scenario, where the grid has the Transaction as provider and has row editing enabled. The latter will ensure that transaction will be added after the entire row edit is confirmed.


Transaction state consists of all the updated, added and deleted rows, and their last states.


To get started import the IgxGridModule in the app.module.ts file:

// app.module.ts

import { IgxGridModule } from 'igniteui-angular';

    imports: [..., IgxGridModule],
export class AppModule {}

Then you need to define the igxTransactionService as a provider for the Grid or for some of its parent components:

import { Component } from "@angular/core";
import { IgxGridTransaction, IgxTransactionService } from "igniteui-angular";

    providers: [{ provide: IgxGridTransaction, useClass: IgxTransactionService }],
    selector: "app-grid-with-transactions",
    template: "<ng-content></ng-content>"
export class GridWithTransactionsComponent { }

IgxGridTransaction is an injection token defined by the grid.

Then define a Grid with bound data source and rowEditable set to true and bind:

    <igx-grid #gridRowEditTransaction [data]="data" [primaryKey]="'ProductID'" width="100%" height="500px"
<button igxButton [disabled]="!undoEnabled" (click)="undo()">Undo</button>
<button igxButton [disabled]="!redoEnabled" (click)="redo()">Redo</button>
<button igxButton (click)="commit()">Commit</button>
<button igxButton (click)="discard()">Discard</button>

The following code demonstrates the usage of the transactions API - undo, redo, commit.

export class GridBatchEditingSampleComponent {
    @ViewChild("gridRowEditTransaction", { read: IgxGridComponent }) public gridRowEditTransaction: IgxGridComponent;
    public get undoEnabled(): boolean {
        return this.gridRowEditTransaction.transactions.canUndo;

    public get redoEnabled(): boolean {
        return this.gridRowEditTransaction.transactions.canRedo;

    public undo() {

    public redo() {

    public commit() {

    public discard() {

Disabling rowEditable property will modify Grid to create transactions on cell change and will not expose row editing overlay in the UI.

API References

Additional Resources

Our community is active and always welcoming to new ideas.