如何将gridview导出为ex​​cel并排除页脚

时间:2014-02-25 11:21:19

标签: asp.net excel

我想将asp.net中的gridview导出为ex​​cel但排除页脚行。我怎样才能做到这一点?

1 个答案:

答案 0 :(得分:1)

您可以在导出时隐藏它:

myFiles.FooterRow.Visible = false;

这样的事情: -

private void ExportGridView()
        {
            System.IO.StringWriter sw = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);

            myFiles.FooterRow.Visible = false;

            //.........
        }