Buenas, Espero te sirva esta funcion..
private void Button1_Click(object sender, System.EventArgs e) {
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
Response.AddHeader("Contenet-Disposition","inline;filename=arhivo.xls");
this.EnableViewState = false;
System.IO.StringWriter sWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWriter = new System.Web.UI.HtmlTextWriter(sWriter);
DataGridFilas.ShowHeader=true;
DataGridFilas.FooterStyle.Wrap=false;
DataGridFilas.RenderControl(htmlWriter);
Response.Write(sWriter.ToString());
Response.End();
}
Juan Dario Atehortua S