5

PDFにエクスポートしたくない列がいくつかあるGridViewがあります(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 に答える