Datagrid not showing if no data

T

tshad

I have 5 datagrids that I want to show even if there is no data in them.

I would like the header to show, even if there is nothing in it.

They are all set to visible=true, is there some other setting to force the
header to show?

Thanks,

Tom
 
T

Trevor Benedict R

You would have to set the DataSource to an a Source (DataTable etc) W/ no
items or Rows and then calll the DataBind Event.

Regards,

Trevor Benedict R
MCSD
 
T

tshad

Patrick.O.Ige said:
Did u set Autogeneratecolums=True?

That wouldn't solve the problems as I need this parameter to be be false.

The datagrid I am using at the time is:

<asp:DataGrid
PagerStyle-Visible="false"
AutoGenerateColumns="false"
Visible=true
CellPadding="0"
CellSpacing="0"
ID="DataGrid1"
runat="server"
ShowFooter="false"
ShowHeader="true"
BorderWidth="1"
BorderColor="#999999"
style="width:616px">
<columns>
<asp:TemplateColumn HeaderText="Company Information:"
HeaderStyle-Font-Bold="true" HeaderStyle-BackColor="#CCCCCC"
ItemStyle-Width="153" ItemStyle-ForeColor="Red"
ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID="PolicyLabel" Text='<%#
DataBinder.Eval(Container.DataItem, "Policy") %>' Runat="server" />
</ItemTemplate>
</asp:TemplateColumn>
</columns>
</asp:DataGrid>
</itemtemplate>
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top