title: How i can convert date to text while exporting datagridview to excel?
body: <p>I am having a problem while exporting data-grid view to excel. 
  In the datagridview there is column with dates like 12/5/2014.</p>
  
  <p>When i export it using this code</p>
  
  <pre><code>Microsoft.Office.Interop.Excel.Application app = new Microsoft.Office.Interop.Excel.Application();
  app.Visible = true;
  Microsoft.Office.Interop.Excel.Workbook wb = app.Workbooks.Add(1);
  Microsoft.Office.Interop.Excel.Worksheet ws = (Microsoft.Office.Interop.Excel.Worksheet)wb.Worksheets[1];
  
  ws.Name = "Exported from gridview";
  
  ws.Rows.HorizontalAlignment = HorizontalAlignment.Center;
  
  for (int i = 1; i &lt; ExcelDGV.Columns.Count + 1; i++)
  {
      ws.Cells[1, i] = ExcelDGV.Columns[i - 1].HeaderText;
  }
  
  
  // storing Each row and column value to excel sheet
  for (int i = 0; i &lt; ExcelDGV.Rows.Count - 1; i++)
  {
      for (int j = 0; j &lt; ExcelDGV.Columns.Count; j++)
      {
          ws.Cells[i + 2, j + 1] = ExcelDGV.Rows[i].Cells[j].Value.ToString();
      }
  }
  
  ws.Cells.EntireColumn.AutoFit();
  
  wb.SaveAs("c:\\output.xls",Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing,Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlExclusive , Type.Missing, Type.Missing, Type.Missing, Type.Missing);
  
  app.Quit();
  </code></pre>
  
  <p>It shows up up like that 12/05/2014 12:00 AM</p>
  
  <p>I don't want it to be like that. 
  I want it to just be 12/05/2014.
  How i do that in the for loop that is what i mean ??</p>
  
  <p>I want to detect if the cell value is string convert it to this format </p>
  
  <p>and for your information the datagridview already has the date is this format dd/MM/yyyy</p>
  
  <p>this problem only occurred when exporting</p>
  
  <p>any one knows how to solve it ?</p>