【发布时间】:2014-11-08 07:25:44
【问题描述】:
我有一个网格视图,我在其中添加、更新数据。要添加数据,我使用了页脚模板。在页面加载网格视图数据源为空,因此它不显示页脚 - 有页眉的属性
ShowHeaderWhenEmpty="True"
但我没有找到添加页脚的属性。 网格视图为空时如何显示页脚?
【问题讨论】:
-
你想在页脚显示什么??图片??文字??
-
添加新行的控件
我有一个网格视图,我在其中添加、更新数据。要添加数据,我使用了页脚模板。在页面加载网格视图数据源为空,因此它不显示页脚 - 有页眉的属性
ShowHeaderWhenEmpty="True"
但我没有找到添加页脚的属性。 网格视图为空时如何显示页脚?
【问题讨论】:
试试这样的:
<asp:GridView ID="gvCustomers" runat="server" Width="550px"
AutoGenerateColumns="false"
Font-Names="Arial" Font-Size="11pt" AlternatingRowStyle-BackColor="#C2D69B"
HeaderStyle-BackColor="green"
AllowPaging="true" ShowFooter="true" OnPageIndexChanging="OnPaging" PageSize="10">
<Columns>
<asp:BoundField HeaderText="CustomerID" DataField="CustomerId" FooterText="Footer" />
<asp:BoundField HeaderText="Contact Name" DataField="ContactName" FooterText="Footer" />
<asp:BoundField HeaderText="Company Name" DataField="CompanyName" FooterText="Footer" />
</Columns>
<AlternatingRowStyle BackColor="#C2D69B" />
</asp:GridView>
【讨论】: