Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从GridView中删除列_C#_Asp.net_Itextsharp - Fatal编程技术网

C# 从GridView中删除列

C# 从GridView中删除列,c#,asp.net,itextsharp,C#,Asp.net,Itextsharp,我有一个GridView,其中有几列我不想导出为PDF(通过iTextSharp) 在导出数据之前,如何隐藏不希望导出的列?在导出数据之前,请执行以下操作: myGridView.columns.RemoveAt(index); //Index is the index of the column you want to remove myGridView.Databind(); 或尝试 dataGridView1.Columns[index].Visible = false; //

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


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

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

myGridView.columns.RemoveAt(index);    //Index is the index of the column you want to remove
myGridView.Databind();
或尝试

  dataGridView1.Columns[index].Visible = false; // the index of the column to be hidden