is there pageindex or pagecount for repeater? i able to do with gridview and could not find much with repeater and not in code-behind too, how would i do PageIndex and PageCount in Repeater?

 Page <%# rpt.PageIndex + 1 %> of <%# rpt.PageCount %>


<asp:Repeater ID="rpt" runat="server" OnItemCommand="rpt_OnItemCommand" OnItemDataBound="rpt_OnItemDataBound">
    <HeaderTemplate>
           <div >
                <div >
                     Page <%# rpt.PageIndex + 1 %> of <%# rpt.PageCount %>
                </div>
            </div>
     </HeaderTemplate>
     <ItemTemplate ......
</asp:Repeater>
有帮助吗?

解决方案

Repeater control does not support paging out of the box, which means you have to implement it yourself. One way (and the easiest probably) is to use PagedDataSource object, which encapsulates paging-related properties and logic. There is a couple of examples in web on how to accomplish this: example one, example two, example three.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top