Version

Enabling Batch Updating

This topic demonstrates how to enable batch updating for the WebDataGrid™ and how the user can undo the changes made during batch updating.

Introduction

When batch updating is enabled, an unlimited number of rows can be modified without calling the server, as it is the case with the “normal” editing behavior. With batch updating, all changes – adding, updating, deleting rows are kept on the client and are send to the server on the first triggered postback. The picture below demonstrates an igGrid with batch update feature enabled.

WebDataGrid Batch Updating Getting Started 01.png

Enabling Batch Updating

To enable batch updating, you only need to set the BatchUpdate property to true in either the markup or the code behind. Note that for the child bands, you need to enable the Batch updating mode separately. This is true for all the child features – you need to specify the batch options individually for every band.

In ASPX:

<ig:WebDataGrid ID="wdg1" runat="server">
    <Behaviors>
        <ig:Activation/>
        <ig:EditingCore BatchUpdating="true">
            <Behaviors>
                <ig:RowAdding/>
                <ig:RowDeleting/>
                <ig:CellEditing/>
            </Behaviors>
        </ig:EditingCore>
    </Behaviors>
</ig:WebDataGrid>

In C#:

this.wdg1.Behaviors.EditingCore.BatchUpdating = true;

To verify the result open the page in your web browser. You should be able to modify rows in a batch as shown in the Introduction.

Note
Note:

When you add a parent row you need to make a postback to save it to the database. Only after that you can add, delete, or update any child rows.

Recovering the Original Data

A great advantage of the batch update feature is that, as long as you are in Batch Update mode (that is, the changes have not been committed to the server yet), you can to recover every modified row data to its original state.

Recovering is done one row at a time, by placing the focus on the row to be recovered. After that:

  • Press Ctrl+Z to undo the edits made to the row

  • Click the Undo hover button to restore a deleted row

WebDataGrid Batch Updating Getting Started 02.png
Note
Note:

Apart from mouse click, the Undo button can be activated by pressing either Enter or the Space key on the keyboard.