从GridView中删除列

5 c# asp.net itextsharp

我有一个带有几列的GridView,我不想将其导出为PDF(通过iTextSharp).

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

Max*_*Max 8

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

myGridView.columns.RemoveAt(index);    //Index is the index of the column you want to remove
myGridView.Databind();
Run Code Online (Sandbox Code Playgroud)