我正在使用分页,pageindex 是 10。我正在使用背景色 #3F3F3F 来 header 和分页。如果 gridview 没有 10 行,则分页不显示并且不显示颜色,所以我的设计不是很好...
我可以在页脚中保留页码吗,这样它就会给我的页脚提供背景颜色#3F3F3F..
<asp:GridView runat="server" ID="gv_viewincident" CssClass="gridviewdesign" AutoGenerateColumns="False" GridLines="None" EmptyDataText="No Record Found"
AllowPaging="true" PageSize="10"
onpageindexchanging="gv_viewincident_PageIndexChanging" >
请帮忙
最佳答案
您可以使用 PageStyle 和 PageTemplate 自定义分页器设置。例如,请参见下面的代码段
<asp:gridview id="CustomersGridView"
datasourceid="CustomersSource"
autogeneratecolumns="true"
emptydatatext="No data available."
allowpaging="true"
runat="server">
<pagersettings mode="Numeric"
position="Bottom"
pagebuttoncount="10"/>
<pagerstyle backcolor="LightBlue"
height="30px"
verticalalign="Bottom"
horizontalalign="Center"/>
</asp:gridview>
关于asp.net - 如何在 asp.net c# 的 GridView 中显示页脚内的分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22347314/