避免在GridView的分页(按钮(出口))

问题描述 投票:1回答:1
protected void Button3_Click(object sender, EventArgs e) //export
{
    GridView2.AllowPaging = false;
    GridViewExportUtil.Export("Сводка.xls", this.GridView2);
    GridView2.AllowPaging = true;
}

我需要避免XLS出口分页: - /

c# asp.net gridview export
1个回答
2
投票

可以实现这样的...有一个尝试,请

protected void btnExportExl_Click(object sender, EventArgs e)
{
    grd.Allowpaging = false;
    grd.DataBind(); // you need to rebind the gridview
    grd.RenderControl(htw);
    Response.Write(sw.ToString());
    Response.Flush();
    Response.End();

    grd.Allowpaging = true;//Again do paging to gridview
    grd.DataBind();
}
© www.soinside.com 2019 - 2024. All rights reserved.