玄铁剑

成功的途径:抄,创造,研究,发明...
posts - 128, comments - 42, trackbacks - 0, articles - 174

导航

<2025年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

常用链接

留言簿(5)

随笔分类

随笔档案

文章分类

收藏夹

AJAX

asp.net網絡鏈接

Delphi Link

IronPython

Microsoft

Other Blogs

OtherSite

SliverLight

Test

免费asp.net控件

其它链接

搜索

  •  

积分与排名

  • 积分 - 217536
  • 排名 - 26

最新评论

阅读排行榜

评论排行榜

custom GridView pager

Posted on 2008-03-27 22:44 玄铁剑 阅读(359) 评论(0)  编辑 收藏 引用 所属分类: ASP.NET相关

<PagerTemplate>
    <asp:Label ID="lblPage" runat="server" Text="Page:" ForeColor="blue"></asp:Label>
    <asp:Label ID="lblCurrentPage" runat="server" Font-Bold="true" Text="<%# ((GridView)Container.NamingContainer).PageIndex + 1 %>"
        ForeColor="red"></asp:Label>/
    <asp:Label ID="lblPageCount" runat="server" Font-Bold="true" Text="<%# ((GridView)Container.NamingContainer).PageCount %>"
        ForeColor="black"></asp:Label>       
    <asp:LinkButton ID="lbtnFirstPage" runat="server" CommandName="Page" CommandArgument="First" Text="First"
        Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>"></asp:LinkButton>
    <asp:LinkButton ID="lbtnPreviousPage" runat="server" Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>" Text="Prev"
        CommandName="Page" CommandArgument="Prev"></asp:LinkButton>
    <asp:LinkButton ID="lbtnNextPage" runat="server" CommandName="Page" CommandArgument="Next" Text="Next"
        Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"></asp:LinkButton>
    <asp:LinkButton ID="lbtnLastPage" runat="server" CommandName="Page" CommandArgument="Last" Text="Last"
        Enabled="<%# ((GridView)Container.NamingContainer).PageIndex != ((GridView)Container.NamingContainer).PageCount - 1 %>"></asp:LinkButton>       
</PagerTemplate>
<PagerStyle CssClass="GridPager"  HorizontalAlign="Center"/>

 

只有注册用户登录后才能发表评论。