User-271186128 posted
Hi Lexi85,
You can refer to the following code: Use a Repeater control to display the page number:
<asp:GridView ID="grdDemo" runat="server" AutoGenerateColumns="False" DataKeyNames="CategoryID">
<Columns>
<asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" />
<asp:BoundField DataField="CategoryName" HeaderText="CategoryName" SortExpression="CategoryName" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
</Columns>
</asp:GridView>
<asp:Repeater ID="rptPager" runat="server">
<ItemTemplate>
<asp:LinkButton ID="lnkPage" runat="server" Text='<%#string.Format("page{0} ", Eval("Text")) %>' CommandArgument='<%#Eval("Value") %>' Enabled='<%#Eval("Enabled") %>'
OnClick="lnkPage_Click" ForeColor="#267CB2" Font-Bold="true" />
</ItemTemplate>
</asp:Repeater>
More details, see:
http://www.aspsnippets.com/Articles/ASPNet-GridView-Custom-Paging-with-PageSize-Change-Dropdown.aspx
Best regards,
Dillion