Version

Events

This topic explains the client and server events related to batch updating in the WebDataGrid™.

Batch Updating Client Events

The activation of the batch updating functionality fires two client events that you can use when undoing modified rows:

  • batchUndone - fired upon recovering a deleted row (the user has clicked the Undo button)

  • batchUndoing - fired upon restoring a change made to a row (the user has pressed Ctrl+Z)

The following markup code snippet demonstrates how to attach to these events.

In ASPX:

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

The following markup code snippet demonstrates how to define handlers using Javascript:

In Javascript:

function batchUndoing(sender, eventArgs) {
}
function batchUndone(sender, eventArgs) {
}

The arguments events store information about the row that is being undone. You can cancel the undo process and leave modifications made the data inside the BatchUpdateUndoing event handler.

For further details, refer to the Batch Update Events sample.

For more detailed information for the events’ arguments, refer to the Batch Update API.

Table 1: Reference table for the client event arguments

Arguments Descripton

Pointer to the WebDataGrid client side DOM object.

Object that contains information for the client event and current context.

Batch Updating Server Events

In batch updating, the same server events are fired as when batch updating is disabled, but the events are called all in one pass when the postback takes place.

The following snippet demonstrates how to attach handlers to server CRUD events in ASPX and in the code-behind:

In ASPX:

<ig:WebDataGrid ID="wdg1" runat="server"
    OnRowUpdating="wdg1_RowUpdating" OnRowUpdated="wdg1_RowUpdated"
    OnRowAdding="wdg1_RowAdding" OnRowAdded="wdg1_RowAdded"
    OnRowsDeleting="wdg1_RowsDeleting" OnRowDeleted="wdg1_RowDeleted">
    <Behaviors>
        <ig:Activation/>
        <ig:Paging PageSize="7"/>
        <ig:EditingCore BatchUpdating="true">
            <Behaviors>
                <ig:RowAdding/>
                <ig:RowDeleting/>
                <ig:CellEditing/>
            </Behaviors>
        </ig:EditingCore>
    </Behaviors>
</ig:WebDataGrid>

In C#:

void wdg1_RowUpdating(object sender,
                      Infragistics.Web.UI.GridControls.RowUpdatingEventArgs e) {}
void wdg1_RowUpdated(object sender,
                     Infragistics.Web.UI.GridControls.RowUpdatedEventArgs e) {}
void wdg1_RowAdding(object sender,
                    Infragistics.Web.UI.GridControls.RowAddingEventArgs e) {}
void wdg1_RowAdded(object sender,
                   Infragistics.Web.UI.GridControls.RowAddedEventArgs e) {}
void wdg1_RowsDeleting(object sender,
                       Infragistics.Web.UI.GridControls.RowDeletingEventArgs e) {}
void wdg1_RowDeleted(object sender,
                     Infragistics.Web.UI.GridControls.RowDeletedEventArgs e) {}

Table 2: Reference table for the server event arguments

Arguments Descripton

Pointer to the WebDataGrid server instance.

Object that contains information for the server event and current context.