Response.Clear();
Response.Buffer=true;
Response.ContentType="application/vnd.ms-excel";
Response.Charset="";
this.EnableViewState=false;
Response.Buffer=true;
Response.ContentType="application/vnd.ms-excel";
Response.Charset="";
this.EnableViewState=false;
stringwriter sw=new stringwriter();
HtmlTextWriter htw=new HtmlTextWriter(sw);
YoueDataGrid.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();