Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
Reading multiple XML files into Ultragrid and saving changes back to xml files

I'm writing an application that will read up to 150-200 XML files into an ultragrid. I want to be able to edit the data in the grid and then write the changes back to each XML. Each XML file has the same schema. Each XML has anywhere from 50-300 nodes that represent each row read into the grid.

I'm looking for the best way to do this. I'm currently using Linq to read all the XML into a datatable and then putting that into the grid. Now I just need to be able to save changes made in the grid back to the XML.

Each node I'm reading into the grid does have a key field that is read into the grid, that key is unique in the file but will be duplicated in all the other XML. The best idea I have had so far is to identify the filename and the row being edited and then use something like WriteXML to write back to the file and node.

Would this be the best way or is there another way that might work better?

  • 30110
    Verified Answer
    Offline posted

    Hello Clint,

    My team and I have done an initial review of this post, and it sounds like the method that you are currently following is likely the best way of reading the XML into the UltraGrid and then writing it back out.

    For more information about reading XML data into an application, I would recommend taking a look at this documentation article.

    The above documentation also references WriteXml to write back to your files, and being that you have a "key field" that is being read, this should help you identify which file and which node to write to. As such, I would recommend continuing with that.

    Please let me know if you have any other questions or concerns on this matter.

Reply Children
No Data