Hi Ssekamatte,
Greetings from Syncfusion support.
We could see that, you are adding a row with Null values into db when clicking on Add button using OnActionBegin event handler. So at these cases, by default the new row with Null values will be added to db immediately once Add button is clicked.
Based on your scenario we suggest you not to add empty row into db when pressing Add button. Instead add row only when clicking Save, by checking the below highlighted condition in ActionBeginHandler as like below code,
|
public async void ActionBeginHandler(ActionEventArgs<NationalizationPlan> args)
{
...
else if (args.RequestType == Syncfusion.Blazor.Grids.Action.Save && args.Action== "Add")
{
PreviousAction = Syncfusion.Blazor.Grids.Action.Add;
using (var db = new EWAPSContext())
{
...
Args.RowData.NationalizationPlanId = id;
db.NationalizationPlan.Add(Args.RowData);
db.SaveChanges();
}
...
}
}
|
Please get back to us if you need further assistance.
Regards,
Renjith R