Hi Ahmed,
Greetings from Syncfusion support
From your update, we could see that you like to delete the adding record in batch mode. Based on your query we have prepared a sample and we suggest you use the below way to achieve your requirement. Please refer the below code example and sample for more information.
|
<button id="store" onclick="deleteRecord()">Delete Adding Record</button>
<ejs-grid id="Grid" dataSource="ViewBag.dataSource" allowPaging="true" toolbar="@(new List<string>() { "Add","Delete","Update","Cancel" })">
<e-grid-editSettings allowAdding="true" allowDeleting="true" allowEditing="true" mode="Batch"></e-grid-editSettings>
<e-grid-columns>
. . . . . . . . . .
. . . . . . . . . .
</e-grid-columns>
</ejs-grid>
</div>
<script>
function deleteRecord() {
var grid = document.getElementById('Grid').ej2_instances[0]; //grid instance
//we have delete the 1st row
var getUid = grid.getRowsObject()[0].uid; //get uid from RowsObject
var rowElement = grid.getRowElementByUID(getUid); //get the tr element by using uid
grid.deleteRow(rowElement); //delete the adding record by passing the tr element.
}
</script>
|
Regards,
Rajapandi R