title: How to display gridLines in GridView from code behind
body: <p>In aspx code i set <code>GridLines="None"</code></p>
  
  <p>How can i show GridLines from code behind when exporting grid-view to excel file.</p>
  
  <pre><code>protected void btnexcel_Click(object sender, EventArgs e)
  {
          Response.Clear();
          Response.Buffer = true;
          Response.AddHeader("content-disposition",
           "attachment;filename=UsersReport.xls");
          Response.Charset = "";
          Response.ContentType = "application/vnd.ms-excel";
          StringWriter sw = new StringWriter();
          HtmlTextWriter hw = new HtmlTextWriter(sw);
          gridusers.DataBind();
          gridusers.RenderControl(hw);
          //style to format numbers to string
          string style = @"&lt;style&gt; .textmode { mso-number-format:\@; } &lt;/style&gt;";
          Response.Write(style);
          Response.Output.Write(sw.ToString());
          Response.Flush();
          Response.End();
  }
  </code></pre>