2X faster development
The ultimate ASP.NET MVC UI toolkit to boost your development speed.
Problem How to process the XML response from server and bound the result to Grid? Solution Essential Javascript DataManager works well with JSON data, but when comes with xml, we need custom adaptor to achieve this requirement. In the custom adaptor, the processResponse has to be overridden to process the xml response from the server. In the below code snippet, we have extended processResponse method of the ej.UrlAdaptor and in the extended method, the xml data from the server is converted into JSON array. Now it can bound with grid. In the following code, we have performed simple Xml to Json conversion in the function “ConvertToJSON”, which will parse the simple xml document to json, for complex xml parsing, you can use external libraries.
Now let us see, how to use the above custom adaptor (named xmlAdaptor) in the grid. Render the grid and assign the custom adaptor to the grid datasource in the grid Load event. Grid Initialization JS
Razor:
Webforms:
Angular 2 with MVC backend
Asp.Net core:
Figure 1. Response from the server as XML
Figure 2. Grid with data from XML source |
2X faster development
The ultimate ASP.NET MVC UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.