我一直试图找出为什么会发生这种情况,但由于某种原因,gembox.spreadsheet.winformutilities 的 .net 不会在代码上提供 ExportToDataGridView:
using System.Windows.Forms;
using GemBox.Spreadsheet;
using GemBox.Spreadsheet.WinFormsUtilities;namespace Excel
{
public partial class UserControl1 : UserControl
{
private void bunifuFlatButton2_Click(object sender, EventArgs e)
{
OpenFileDialog open = new OpenFileDialog();
open.Filter = "Al files (*.*)|*.*|";
open.FilterIndex = 1;
if (open.ShowDialog()== DialogResult.OK)
{
ExcelFile ef = new ExcelFile();
ExcelWorksheet ws = ef.Worksheets.Add("Export");
DataGridViewConverter.***ExportToDataGridView***(ef.Worksheets.ActiveWorksheet, this.dataGridView1, new ExportToDataGridViewOptions() { ColumnHeaders = true });
}
}
}
}
提前感谢您的回答!