views:

30

answers:

1

How can I edit a xml file using JQGrid? I am using ASP.Net MVC 3.5 with C#. Is it possible to return a JSon object from controller method for this purpose?

A: 

Everything is possible. But the most work which you have to do is independ from the jqGrid. Moreover general XML file can be not good represented in a grid. If the deepness of the XML file not so long, you can use subgrid feature of the jqGrid. One more restriction existing in the jqGrid can make the work more comple: jqGrid not support data with attributs other as ids. So if you will have to map attributes to the sub-elements on the server side to be able to use jqGrid.

The ASP.NET MVC site can for example read the XML file with respect of some desirialization methods and initialize the object with the same information as the XML has. Then can use the object to fill the jqGrid and modify the data. Because th data are no mo represented as a XML, the server can use JSON to communicate with the jqGrid. At the end one can use one from wel known serialization methods so save modified data in the XML file back.

Oleg