gridview doesnot show hearder text? RRS feed

  • Question

  • User1806930132 posted

    Hello I have the below code for gridview but its not showing the header text when I run the app,it doesnot show hearder text its just an blank row with data below

      <tr><td class="auto-style3">Circuits</td></tr>
             <tr><td><asp:GridView runat="server" ID="GridView4" showfooter="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" OnRowCommand="GridView4_RowCommand" DataSourceID="SqlDataSource1" DataKeyNames="Id" HeaderStyle-Font-Bold="true"  
                             <asp:TemplateField HeaderText=" Id">
        <ItemTemplate><%# Eval("Id") %></ItemTemplate>
        <asp:TextBox runat="server" ID="Id" Text='<%# Bind("Id")%>' />
        <asp:TextBox runat="server" ID="txtid" Text='' />

    Monday, May 9, 2016 9:36 AM


  • User753101303 posted


    AFAIK, the HeaderText attribute is for BoundField for example. For a TemplateField, try to define a HeaderTemplate as you have done for the footer.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 9, 2016 9:44 AM