Skip to main content

ASPxClientGridViewBatchEditApi.EndEdit Method

Ends cell or row editing.

Declaration

EndEdit(): void

Remarks

Based on the control’s EditMode property value, the BatchEditApi.EndEdit method ends cell or row editing.

When you call the BatchEditApi.EndEdit method, the control raises the client-side BatchEditEndEditing event and switches to browse mode – hides in-place editors.

The code sample below adds a new row and calls the EndEdit method to allow the grid to assign new cell values to the inserted row.

<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" KeyFieldName="CustomerID"
    ClientInstanceName="clientGrid">
    <Columns>
        <dx:GridViewDataTextColumn FieldName="ContactName" />
        <%--...--%>
    </Columns>
    <SettingsEditing Mode="Batch" />
</dx:ASPxGridView>

<dx:ASPxButton ID="ASPxButton1" runat="server" Text="Add New Row" AutoPostBack="false">
    <ClientSideEvents Click="OnButtonClick" />
</dx:ASPxButton>
function OnButtonClick(s, e) {
    // Add a new row
    clientGrid.batchEditApi.AddNewRow();
    // Get the visible index of the row that contains the cell in edit mode
    var rowIndex = clientGrid.batchEditApi.GetEditCellInfo().rowVisibleIndex;
    // End cell editing
    clientGrid.batchEditApi.EndEdit();
    // Assign a new value to the specified cell
    clientGrid.batchEditApi.SetCellValue(rowIndex, 'ContactName', 'New customer');
}

Online Example

View Example: ASPxGridView in Batch Edit mode - Implement the Select All feature for the CheckBox column (WebForms)

See Also