从MetroGridView导出Excel

时间:2018-12-17 12:30:21

标签: c# winforms datagridview microsoft-metro

我将Metro网格导出为ex​​cel,但出现错误enter image description here

帮助我解决此错误

for(int i=0;i<metroGrid1.RowCount;i++)
            {
                for(int j=0;j<metroGrid1.ColumnCount;j++)
                {
                    oSheet.Cells[i + 3, j + 1] = metroGrid1.Rows[i].Cells[j].Value.ToString();
                }
            }

0 个答案:

没有答案