5

我有一个 GridView,其中有几列我不想导出到 PDF(通过 iTextSharp)。

如何在导出数据之前隐藏不想导出的列?

4

2 回答 2

8

在导出数据之前,请执行以下操作:

myGridView.columns.RemoveAt(index);    //Index is the index of the column you want to remove
myGridView.Databind();
于 2009-08-01T08:40:26.373 回答
2

或尝试

  dataGridView1.Columns[index].Visible = false; // the index of the column to be hidden
于 2009-08-01T09:50:23.157 回答