Datagrid not diplaying header text

A

Atif Jalal

I am trying have a datgrid which always displays the column header
text, even though the datareader to which it is bound is empty.

I have a datagrid on my page with data source bound to datareader. The
datagrid does not display the header text when the datareader returns
zero records.
 
R

Rajesh Tiwari

use boundcolumn
it will solve ur problem
e.g.
<asp:datagrid id=grd runat=server Border=1 ShowFooter="false"
Font-Color="Green"
AutoGenerateColumns="true"<columns>
<asp:BoundColumn HeaderText="id" DataField="fname" runat=server/>
</columns>
</asp:datagrid>

Rajesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top