DataGridView 导出时出现的问题。

可能grid行的单元的没有值。

 

------------------------------------------------------------------------------

if (dataGridview1.Rows[j].Cells[k].Value != null)
{
          tempStr += dataGridview1.Rows[j].Cells[k].Value.ToString();
}

相关文章: