public void ActionBegin(ActionEventArgs<OrdersDetails> args)
{
if(args.RequestType.Equals(Syncfusion.Blazor.Grids.Action.Delete))
{
args.Cancel = true;
}
}
|
Thanks Jeevakanth - that works.
Regards, Saeed.
Hi
if in the ActionBeginHandler, rendered async void, a function with await is called (to ask for confirmation via the classic javascript confirm function call) the setting of args.Cancel = true does not work and the line is canceled anyway.
looking forward to your kind reply
Greetings
Hi Salvatore,
Greetings from Syncfusion support.
Based on your description, it sounds like you are experiencing an issue with the cancellation of a line of code in the ActionBeginHandler when using an async void function with await to confirm an action using the classic JavaScript confirm function.
In this scenario, we would recommend using an asynchronous Task function function instead of an async void function. This will allow you to use the await keyword and properly cancel the line of code using the args.Cancel = true statement.
public async Task ActionBeginHandler(ActionEventArgs<Order> args) { // Here, you can customize your code. } |
I hope this helps. If we misunderstood your query then kindly share the below details to proceed further at our end.
Above requested details will be very helpful in validating the reported query at our end and provide solution as early as possible.
Regards,
Monisha