我认为这是你最好和最容易的赌注:http://www.gembox software.com/Spetesh/overview
var bindingSource = (BindingSource)this.peopleDataGridView.DataSource;
var dataTable = ((DataView)bindingSource.List).Table;
var ef = new ExcelFile();
var ws = ef.Worksheets.Add(dataTable.TableName);
// Insert data table in worksheet, starting from worksheet s first row and column and include column headers
ws.InsertDataTable(dataTable, 0, 0, true);
foreach(ExcelCell cell in ws.GetUsedCellRange(true))
cell.Style.FillPattern.SetSolid(Color.Red);
ef.SaveXls(dataTable.TableName + ".xls");
另一个选项是使用“http://www.completit.com/Portfolio/DGVE/Screenshots.aspx” rel=“no follow”>http://www.com/com/Portfollio/DGVE/Screenshots.aspx
[Added 1 more ]
This one converts DGV to XML/XSL which is the best, if you want to manipulate data in HTML or other format along with EXCEL.
http://www.carlosag.net/Tools/ExcelXmlWriter/
以上所有内容均从DGV向EXCEL自由出口格式。