Recently I came across a Requirement where I was needed to add the Paging functionality to the repeater Control because the repeater control didn't have the built in functionality for paging.
At the source code add the following code :
<asp:Repeater ID="rptXYZ" runat="server">
..........Your repeter content
</Asp:Repeater >
<table>
<tr>
<td><asp:button id="cmdPrev" runat="server" text=" << "></asp:button> </td>
<td> <asp:Panel id="PnlNumber" runat="server"></asp:Panel> </td>
<td> <asp:button id="cmdNext" runat="server" text=" >> "></asp:button> </td>
</tr>
</table>
Here a panel is added to insert a link button dynamically. At the code behind, add the following code :
At gobal declaration
Dim objPds As New PagedDataSource
Create one property as
Public Sub showPagination()
Dim XYZDS As New DataSet
XYZDS = Session("XYZDS")
'' Populate the repeater control with the Items DataSet
If Not XYZDS Is Nothing Then
If Not (XYZDS.Tables("Table1") Is Nothing) Then
Dim ilnkno As Double
Dim Pagerpagesize As Integer
Pagerpagesize = 3
'' (any) Number of record to show at one go
ilnkno = XYZDS.Tables("Table1").Rows.Count / Pagerpagesize
'' ilnkno is Number of link buttons to add
Join the conversation! Your thoughts help the community grow.