Hi RakhiS,
Thanks for contacting Syncfusion support.
We have validated your requirement. You can achieve your requirement by enabled ‘allowSorting’ option in Grid and call the ‘sortColumn()’ method in actionComplete(with requestType as ‘batchSave’) event. Please find the code example and sample for your reference.
[app.component.html]
<ejs-grid #grid allowSorting='true' (actionComplete)="actionComplete($event)" [dataSource]='data' allowPaging='true' [editSettings]='editSettings' [toolbar]='toolbar'>
<e-columns>
<e-column field='OrderID' headerText='Order ID' width='120' textAlign='Right' isPrimaryKey='true' [validationRules]='orderidrules'></e-column>
. . .
</e-columns>
</ejs-grid>
[app.component.ts]
export class AppComponent {
. . .
@ViewChild('grid')
public grid : GridComponent;
actionComplete(args) {
if (args.requestType == 'batchsave') {
this.grid.sortColumn('OrderID', "Descending")
}
}
. . .
}
In the above code example, we have applied descending order for the OrderID column when added new records or edited records into Grid(we called the sortColumn() method, after the new or modified data successfully saved).
API DOC:
Note :
By default, the Grid operation such as Sorting, Paging, and Filtering, etc., will be performed by the client-side (front end) when we only bind the Grid data as local.
We are suggesting using ‘RemoteSaveAdaptor’ If you want to perform the Grid actions(such as Sorting, Paging, and Filtering) in the client-side and performing CRUD operation in the server-side. Please find the documentation for your reference.
Regards,
J Mohammed Farook