2010-03-04 60 views
2
protected void Button3_Click(object sender, EventArgs e) //export 
{ 
    GridView2.AllowPaging = false; 
    GridViewExportUtil.Export("Сводка.xls", this.GridView2); 
    GridView2.AllowPaging = true; 
} 

我需要避免pageing爲XLS出口: -/避免的GridView pageing(按鈕(出口))

回答

3

可以實現這樣的...有一個嘗試,請

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(); 
} 
+0

什麼是htw? – Cynede 2010-03-04 11:11:29

+0

你們剛換了換頁後重新綁定有幫助,謝謝你很多<3 – Cynede 2010-03-04 11:19:56