Hi Fabio,
Greetings from Syncfusion support.
Based on your requirement, you want to add a new record in a desired index on a button click and move the record to edit mode. Your requirement can be achieved by adding the row in the click event of the button using the `addRecord` method and in the actionComplete event of the grid you can select the row using `selectRow` method and move the selected row to the edit mode using the `startEdit` method.
Please refer the below code example.
public actionComplete(args) {
if (args.requestType == 'save' && this.isCustomadd) {
this.isCustomadd = false;
this.grid.selectRow(1); // select the added row by using the rowIndex
this.grid.editModule.startEdit(); // Call the startEdit method to edit the selected row
}
}
public btnClick() {
this.isCustomadd = true;
this.grid.addRecord(
{
OrderID: 12345,
CustomerID: 'VINET',
OrderDate: '1996-07-04T10:10:00.000Z',
ShippedDate: '1996-07-16T12:20:00.000Z',
Freight: 32.38,
ShipName: 'Vins et alcools Chevalier',
ShipAddress: '59 rue de l"Abbaye',
ShipCity: 'Reims',
ShipRegion: null,
ShipCountry: 'France',
},
1
);
|
Please get back to us for further details.
Regards,
Joseph I.