title: Export DataGrid to Excel C# winform
body: <p>I'm looking for how to export a datagrid (not datagridview) to Excel. I am working on VS 2003 Winform. I'm looking on the net, but without result, and I find that solutions are just about Datagridview VS 2010 (asp).</p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>lblMessage.Text = ""; 
  // Export all the details 
  try 
  { 
      // Get the datatable to export 
      DataTable dtEmployee = dsEmployee.Tables["Employee"].Copy(); 
      // Export all the details to Excel 
      RKLib.ExportData.Export objExport = new RKLib.ExportData.Export("Win");
      objExport.ExportDetails(dtEmployee, Export.ExportFormat.Excel, "C:\\EmployeesInfo.xls");
      lblMessage.Text = "Successfully exported to C:\\EmployeesInfo.xls";
  }
  catch(Exception Ex)
  { 
      lblMessage.Text = Ex.Message;
  }
  </code></pre>