Question : ASP GridView Column names

have a data bound gridview on a ASP page.  when there's no data in the database I don't see the column names.  how can we get them to show.  they're fine when data is present.  using Web Expressions 3

Answer : ASP GridView Column names

look at this page...

http://msdn.microsoft.com/en-us/library/aa479353.aspx

set AutoGenerateColumns="False"

add your columns like this

<Columns>
        <asp:BoundField HeaderText="Last" DataField="LastName" SortExpression="LastName"></asp:BoundField>
        <asp:BoundField HeaderText="First" DataField="FirstName" SortExpression="FirstName"></asp:BoundField>
        <asp:BoundField HeaderText="Hire Date" DataField="HireDate" SortExpression="HireDate"  DataFormatString="{0:d}"></asp:BoundField>
        <asp:TemplateField HeaderText="Seniority">
            <ItemTemplate>
                <%# ComputeSeniorityLevel(DateTime.Now  (DateTime)Eval("HireDate")) %>
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
Random Solutions  
 
programming4us programming4us