簡體   English   中英

從GridView中刪除列

[英]Delete Columns from GridView

我有一個帶有幾列的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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM