Server Side Validation Messages

I am prototyping a Blazor Server application that communicates with a legacy Web API (Lightswitch). I have written a Custom DataAdaptor that is able to capture the validation results/errors but now I need to pass the validation results/errors back to the Grid editor.

The problem is, the Data Manager does not know anything about the EditContext that was created by the Grid to for the form so there is no way to communicate the server generated validation results back to the editor.

Am I missing something? Is there a way to communicate Validation Results from a Data Adaptor to the Grid?

Many Thanks,

Ian


5 Replies

RS Renjith Singh Rajendran Syncfusion Team July 20, 2022 02:06 PM UTC

Hi Ian,


Greetings from Syncfusion support.


We have documented a similar topic regarding this scenario in the below documentation. Kindly refer the below documentation and use the event to achieve this requirement.

https://blazor.syncfusion.com/documentation/datagrid/data-binding#handling-http-error

https://blazor.syncfusion.com/documentation/datagrid/data-binding#handling-exceptions


Please get back to us if you need further assistance.


Regards,

Renjith R



IE Ian Elbury replied to Renjith Singh Rajendran July 20, 2022 03:52 PM UTC

Thanks for the response. I have spent days looking through your documentation and forum for a solution. Your solutions don't work because:

  1. They are not using a Data Adaptor.
  2. Throwing exceptions in the Data Adaptor's Update/Insert implementations case the form editor to end up in an inconsistent state. i.e. When editing inline, the new row disappears so even when I apply the validations, the row is gone.
I was really hoping that I was not going to have to develop something up outside the Syncfusion framework and I was hoping you would have an elegant solution.

Thanks,

Ian 

 



RS Renjith Singh Rajendran Syncfusion Team July 21, 2022 01:36 PM UTC

Hi Ian,


We have analyzed your query and we have discussed the similar scenario in the below thread. Kindly refer the below forum link for more details on achieving this requirement.

http://www.syncfusion.com/forums/175302/set-custom-validation-error-in-default-edit-dialog?reply=Sgz2kW


Please get back to us if you need further assistance.


Regards,

Renjith R



IE Ian Elbury July 21, 2022 03:39 PM UTC

The last thread does not solve my problem as the validations are taking place DURING an insert or update operation.

The architecture of the grid + data adaptor does not allow the propagation of validation results during an insert or update back to the form editor (dialog or normal). This is a real deficiency of your product as this is a common scenerio IMHO.

If I want to use your product, then I have no choice but to move all add/edit operations into my own editing infrastructure to accomplish this requirement.

Thanks for your help,

Ian



RS Renjith Singh Rajendran Syncfusion Team July 22, 2022 02:26 PM UTC

Hi Ian,


We have analyzed your query, we could see that you have found an alternative way to overcome the reported scenario. If so, then we are glad to hear that you have achieved your requirement.


If you are still facing difficulties or if you need further assistance, then the following details would be helpful for us to further analyze your scenario and provide you a suggestion. Kindly share with us the following details to proceed further.


  1. Share a simple issue replicating sample based on your scenario for us to validate.
  2. Share a video demo explaining your requirement or the problem you are facing.
  3. Share the detailed explanation of the requirement or the problem you are facing.


Regards,

Renjith R


Loader.
Up arrow icon