Assuming you have a DataSet or DataTable associated with the DataGrdiView, you could just use DataSet.WriteXml
] to write the lot. If each DGV is based on a DataTable, then create a new DataSet, add both tables, and write the DataSet. You can then read it back with DataSet.ReadXml
] and restore the two tables.