title: How I can save a DatagridView in a Xml and Load A Xml to datagridView?
body: <p>Hi I want to save and load data from a datagridview to a xml. My idea is that I can save my datagridview to a xml how this -> "[date]_[name].xml" and later I can load this data. For this two operations I want to use two methods --> Save() and Load()</p>
  
  <p>Here is my code for saving:</p>
  
  <pre><code>private void Save(DataGridView grid) 
  {
      try
      {
          xmlfile = @"C:\datagrid.xml";
          dataset = (DataSet)InputDataGrid.DataSource;
          dataset.WriteXml(xmlfile);
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);
      }
  }
  </code></pre>
  
  <p>How I can do this?</p>