Mode 1:
I save the data to database in ActionBegin funciton, then I refresh the datasource, so the new data have two records in the datasource. I cant delete and edit the new data for tracker errors.
Mode 2: I saved the data to database in the ActionCompleted Handle, the new added data has no Id.
Only refreshed the page, not a spa.
A client ADD a record in one page. then the others who opened the same page would get the new record in the same time. so I must get the newest record in the database.
I want to know when did the grid componet add the new data to the datasource?
Would you give some advice CRUD about the data grid?
public async void ActionBeginHandler(ActionEventArgs<Country> args)
{
// Here you can customize your code
actionInfo += "ActionBeginHandler, ";
if (args.RequestType == Syncfusion.Blazor.Grids.Action.Save)
{
if (args.Action == "edit")
{
await countryService.UpdateAsync(args.Data);
}
if (args.Action == "add")
{
// await countryService.SaveDataToDatabase();
AmISender = true;
await countryService.AddAsync(args.Data);
}
}
else if (args.RequestType == Syncfusion.Blazor.Grids.Action.Delete)
{
await countryService.RemoveAsync(args.Data);
}
else if (args.RequestType == Syncfusion.Blazor.Grids.Action.Add)
{
}
}