Hi Gergo,
Greetings from Syncfusion support.
We have validated your query and if you want the add form to open at the bottom of the grid, you can set NewRowPosition as Bottom in GridEditSettings. But if you want to save the new record at the end of the datsource list, then we suggest you to set the corresponding index value in args.Index of OnActionBegin event of the grid. Please refer the below code snippet and the sample for your reference.
<SfGrid @ref="Grid" DataSource="@Orders" AllowPaging="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })">
<GridEvents TValue="Order" OnActionBegin="ActionBegin"></GridEvents>
<GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal" NewRowPosition="NewRowPosition.Bottom"></GridEditSettings>
<GridColumns>
<GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" ValidationRules="@(new ValidationRules{ Required=true})" TextAlign="TextAlign.Right" Width="120"></GridColumn>
</GridColumns>
</SfGrid>
@code{
public List<Order> Orders { get; set; }
SfGrid<Order> Grid { get; set; }
public void ActionBegin(ActionEventArgs<Order> args) {
if ((args.RequestType.Equals(Syncfusion.Blazor.Grids.Action.Save) && args.Action == "Add")) {
args.Index = Orders.Count();
//args.Index = (Grid.PageSettings.CurrentPage * Grid.PageSettings.PageSize) - 1;
}
}
|
Documentation :
Please get back to us if you have any other queries.
Regards,
Jeevakanth SP.