We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Handling errors in GridEvents OnActionFailure

Hello There,

I'm trying to use Blazor Controls with some promising results, but right now I faced the problem with error handling in grid (custom adaptor). In my crud operations there is throw exception with message but then OnActionFailure event doesnt trigger. It works only for Read, but not for Insert, Remove, Update. Is this a known issue? Is there any workaround to display error messages from CRUD operations?

```cs
<GridEvents OnActionFailure="ActionFailureHandler" TValue="MyClass">GridEvents>
<EjsDataManager AdaptorInstance="@typeof(MyCustomAdaptor)"
Adaptor="Adaptors.MyCustomAdaptor">
//...
public class MyCustomAdaptor : DataAdaptor
{
public override object Insert(DataManager dm, object value, string key)
{
throw new Exception("Test message"); //I would like to display this message on the page (Exception is thrown)
}
}
//...
public partial class MyClass
{
public void ActionFailureHandler(FailureEventArgs args)
{
//this handler is not even triggered
}
}
```

1 Reply

MB Maran Baskar Syncfusion Team January 17, 2020 11:53 AM UTC

Hi Kamil, 
  
Thanks for contacting Syncfusion support 

 
 
We are able to reproduce the reported problem from our side. We have confirmed this as a defect and will include this fix "OnActionFailure does not triggered when using custom adaptor operations" in our Volume 4 SP1, 2019 release.  

  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
 
Please get back to us if you need further assistance. 
 
  
Regards, 
Maran B 


Loader.
Live Chat Icon For mobile
Up arrow icon