【问题标题】:Delete Columns from GridView从 GridView 中删除列
【发布时间】:2009-08-01 06:48:36
【问题描述】:

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

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

【问题讨论】:

    标签: c# asp.net itextsharp


    【解决方案1】:

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

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

    【讨论】:

      【解决方案2】:

      或者试试

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-05-25
        • 2016-01-30
        • 2014-05-06
        • 2018-11-08
        相关资源
        最近更新 更多