User-893317190 posted
Hi shsu,
You say you could show the header when set ShowHeaderWhenEmpty to true.
After, you say when you load page , the header is not showing.
I'm confused.
I have made a test .When setting ShowHeaderWhenEmpty to true,it shows header well.
Below is my code.
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" DataKeyNames="item_id" DataSourceID="SqlDataSource1" ShowHeaderWhenEmpty="true" >
<Columns >
<asp:BoundField DataField="item_id" HeaderText="item_id" InsertVisible="False" ReadOnly="True" SortExpression="item_id" />
<asp:BoundField DataField="item_name" HeaderText="item_name" SortExpression="item_name" />
<asp:BoundField DataField="content" HeaderText="content" SortExpression="content" />
</Columns>
</asp:GridView>
If it is not your case, could you show your sample code to let us reproduce your problem?
Best regards,
Ackerly Xu