Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 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