try this,
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=filename.doc");
Response.Charset = "";
Response.ContentType = "application/msword";
StringWriter stringWrite = new StringWriter();
HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
grid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
If u run this code now, you will get error - 'Control 'ctl00_ContentPlaceHolder1_grid' of type 'GridView' must be placed 'inside a form tag with runat=server'. so, Don't worry. Just copy and paste the below code. Its done.
public override void VerifyRenderingInServerForm(Control control)
{
}</br>