I have a DataGridView that is populated one row at a time through auser interface and button clicks (no other data sources). Once the DGV has been filled to the user's contentment, they can click a button that should save the current DGV data to an XML file.
|
![Datagridview Datagridview](/uploads/1/2/5/8/125859468/290874650.jpg)
Hi,
I'm about to develope a little application in C# where I need to save some data in an XML file. I'm viewing data from XML file in a DataGridView, but I would like to make changes and save it in the same XML file. I can't get it to save when i make changes or adding new data in the DataGridView.
Here is some code:
Here is some code:
I'm using Save button from a bindingNavigator to save:
I would be glad if you could help.
Thanks in advance.
Thanks in advance.
Edited by kardo: n/a
- 2 Contributors
- forum3 Replies
- 1,135 Views
- 7 Hours Discussion Span
- commentLatest Postby kardo
Recommended Answers
The problem is that you do changes in dgv. So if you want to write all the data from dgv to xml, its best to use DataTable object. Create in on form load, and when you want to save the data into xml, pass data from dgv to dataTable, and …
Jump to PostAll 3 Replies
The problem is that you do changes in dgv. So if you want to write all the data from dgv to xml, its best to use DataTable object. Create in on form load, and when you want to save the data into xml, pass data from dgv to dataTable, and from there to xml file: