ASPxClientGridViewBatchEditApi.GetInsertedRowIndices Method
Gets the visible indexes of inserted rows.
Declaration
GetInsertedRowIndices(): number[]
Returns
Type | Description |
---|---|
number[] | Visible indexes of the inserted rows. |
Remarks
In batch edit mode, call the client-side GetInsertedRowIndices
method to get the visible indexes of inserted rows.
<dx:ASPxGridView ID="ASPxGridView1" runat="server" KeyFieldName="ProductID">
<%--...--%>
<SettingsEditing Mode="Batch" />
<ClientSideEvents BatchEditChangesSaving="OnBatchEditChangesSaving" />
</dx:ASPxGridView>
function OnBatchEditChangesSaving(s, e) {
// Get the number of inserted rows
var insertedRowCount = s.batchEditApi.GetInsertedRowIndices().length;
alert(`The number of inserted rows: ${insertedRowCount}.`);
}
To get information about inserted rows in batch edit mode, you can also use the insertedValues argument property in the BatchEditChangesSaving event handler or call the client-side GetUnsavedChanges method.
For more information on the grid in batch edit mode, refer to the following topic: ASPxGridView - Batch Edit Mode.
See Also