Posted on: 12/10/2013 7:56:31 PM | Views : 660

I have following code and it works fine except that it exports the whole page and I want to export grid only
HttpResponse response = HttpContext.Current.Response; Response.Clear(); response.ClearHeaders(); response.ClearContent(); Response.AddHeader("content-disposition", "attachment;filename=Task Monitor.xls"); Response.Charset = ""; Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; EnableViewState = false;
StringWriter tw = new StringWriter(); System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(tw);
BindTeamProgress();  gvTeamProgress.AllowPaging = false;  gvTeamProgress.Columns[7].Visible = fal ...

Go to the complete details ...