9 Answers, 1 is accepted
By default when a server-side error occurs the relevant information for it would be returned to the client in the Errors field of the response. If you would like to implement additional custom logic in case of an error or prompt the user the recommended option is to use the error event.
It would be nice to see a failure, but all that I see is an empty grid (no errors). Can you try to reproduce this?
In order for the Grid to display data the response from the Read Action should be in a format that is expected by the DataSource. Thus, make sure that you are calling ToDataSourceRedult to the data returned from the Read ActionMethod.
Please check out the Controller tab in the example below that outlines how a Read action would look:
The Read action would be operating with data, thus it would return errors that are related to data operations (e.g. database error, db connection problem, etc.). Such errors would be added to the ModelState and returned by the server-side action. Please check out the article below (step7 and step8) that outlines how to return the ModelState with the respective data.
For handling general exceptions in the application I would suggest using the approach described in the following article:
If you would like to customize the returned result you can define the DataSourceResult manually and specify the Errors field with the relevant information. The example below illustrates how to specify the DataSourceResult fields manually.
in the link referenced by
"The Read action would be operating with data, thus it would return errors that are related to data operations (e.g. database error, db connection problem, etc.). Such errors would be added to the ModelState and returned by the server-side action. Please check out the article below (step7 and step8) that outlines how to return the ModelState with the respective data. "
I don't see a step 7 and step 8. The link doesn't seem to be related at all to what you are referencing. Can you provide an updated link?
Thank you for this question.
Our official documentation has been updated and extended a couple of times for the last two years. Find the appropriate article for handling ModelState errors here:
1. For inline editing:
2. Handling Server-side validation errors(blog article):
I hope this information helps.