GridView header not displaying

时间:2019-04-08 13:08:21

标签: asp.net gridview webforms headertext

I have a simple ASP.NET Webforms project to test some code. It has a GridView which is displaying the data fine but does not display the header.

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" ShowHeaderWhenEmpty="true" ShowHeader="true" CssClass="table table-striped" Width="50%" OnPageIndexChanging="GridView1_PageIndexChanging" OnPreRender="GridView1_PreRender" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
            <HeaderStyle BackColor="LightCyan" Font-Bold="True" ForeColor="MediumBlue" CssClass="headerClass" />
            <Columns>
            <asp:BoundField DataField="Specification" HeaderText="Specification" ItemStyle-Width="50"/>
            <asp:BoundField DataField="Revision" HeaderText="Revision" ItemStyle-Width="50" />
            <asp:BoundField DataField="Id" HeaderText="Id" ItemStyle-Width="50"/>
            <asp:BoundField DataField="Description" HeaderText="Description" ItemStyle-Width="200"/>
        </Columns>
            <PagerSettings Mode="NumericFirstLast" />
    </asp:GridView>

0 个答案:

没有答案