Hi Everyone,
I wrote code for exporting grid view data to excel sheet which is working fine. I am allowing only 20 rows per page in grid. while exporting i am getting only the first page data. but i want to export all the pages grid data to excel. could someone help
me out in this.
protected void imgbtnExportToExcel_Click(object sender, ImageClickEventArgs e)
{
Excel();
}
private void Excel()
{
Response.ClearContent();
Response.Buffer = true;
Response.AddHeader("content-disposition", string.Format("attachment; filename={0}", "Cu.xls"));
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gvCu.AllowPaging = false;
//Change the Header Row back to white color
...
Go to the complete details ...