Skip to main content

ASPxClientGridViewBatchEditApi.RecoverRowByKey(key) Method

Recovers the specified row.

Declaration

RecoverRowByKey(
    key: any
): void

Parameters

Name Type Description
key any

The row’s key value.

Remarks

When the grid is in batch edit mode, call the RecoverRowByKey method to recover the row that is marked as deleted.

<dx:ASPxGridView ID="Grid" ClientInstanceName="ClientGrid" runat="server" ...>
    <!-- ... -->
    <SettingsEditing Mode="Batch" />
</dx:ASPxGridView>
<br />
<dx:ASPxButton ID="RecoverButton" runat="server" Text="Recover rows" AutoPostBack="false">
    <ClientSideEvents Click="OnRecoverButtonClick" />
</dx:ASPxButton>
function OnRecoverButtonClick(s, e) {
    var batchApi = ClientGrid.batchEditApi;
    var selectedRowKeys = ClientGrid.GetSelectedKeysOnPage();
    for (var i = 0; i < selectedRowKeys.length; i++) {
        var rowKey = selectedRowKeys[i];
        if (batchApi.IsDeletedRowByKey(rowKey)) {
            batchApi.RecoverRowByKey(rowKey);
        }
    }
}
See Also