Dont Want Grid view template field when generating the excel sheet
<p>I have GridView  and I want to generate excel sheet of the grid column
there is code of generate excel and button for click. My problem is
that I don't want template field in of grid view column in excel sheet.
I want only BoundField DataField</p>

<pre><code>&lt;asp:ImageButton ID="btnExcel" runat="server" Text="Excel" ToolTip="Excel"  ImageUrl="~/Images/Resources/thumb/excel.png" OnClick="btnExcel_Click" /&gt;
protected void btnExcel_Click(object sender, ImageClickEventArgs e)
{
    ExportToExcel("Repoet.xls", grdReq);
}


public void ExportToExcel(string strFileName, GridView gv)
{
        HtmlForm form = new HtmlForm();
        Response.ClearContent();
        Response.Buffer = true;
        Response.AddHeader("content-disposition", "attachment; filename=" +      strFileName);
        Response.ContentType = "application/excel";
        System.IO.StringWriter sw = new System.IO.StringWriter();
        HtmlTextWriter htw = new HtmlTextWriter(sw);
        form.Controls.Add(gv);
        this.Controls.Add(form);
        form.RenderControl(htw);
        Response.Write(sw.ToString());
        Response.End();
    }
}



&lt;asp:GridView ID="grdReq" runat="server" AutoGenerateColumns="false" CssClass="SimpleGrid"
                OnRowDataBound="grdReq_RowDataBound"&gt;
&lt;Columns&gt;
 &lt;asp:BoundField DataField="CandidateID" HeaderText="Candidate Id" /&gt;
 &lt;asp:TemplateField&gt;
 &lt;ItemTemplate&gt;
   &lt;asp:HyperLink ID="hlnkEvalSheet" runat="server" Text='&lt;%#Eval("Candidate Name") %&gt;'
    CssClass="logo" NavigateUrl='&lt;%# "~/Recruiter/EvalSheets.aspx?ClientId=" +      hdnClientId.Value  + "&amp;ReqId=" + hdnReqId.Value  %&gt;'
    ImageUrl="~/Images/Resources/search.png" &gt;
    &lt;/asp:HyperLink&gt;
 &lt;/ItemTemplate&gt;
 &lt;/asp:TemplateField&gt;

&lt;asp:BoundField DataField="Candidate Name" HeaderText="Candidate Name" /&gt;
&lt;asp:BoundField DataField="Organization" HeaderText="Organization" /&gt;                     &lt;asp:BoundField DataField="Desig" HeaderText="Design" /&gt; 
&lt;asp:BoundField DataField="Overall" HeaderText="Overall" /&gt;
&lt;asp:BoundField DataField="Qualification" HeaderText="Qualification" /&gt; 
&lt;asp:BoundField DataField="Location" HeaderText="Location" /&gt;
&lt;asp:BoundField DataField="Current CTC (LPA)" HeaderText="Current CTC (LPA)" /&gt;
&lt;/Columns&gt;
&lt;/asp:GridView&gt;
</code></pre>
