My project is in dot net framework 4.0. One of the page has a huge number of records to be displayed in the gridview and hence I am using custom paging which is going fine. The problem is the pager which I have made using a repeater control:
<asp:Repeater ID="repeaterPaging" runat="server">
<ItemTemplate>
<asp:LinkButton ID="lnkPage" runat="server" Text='<%#Eval("Text")%>'
CommandArgument='<%#Eval("Value") %>'
Enabled='<%#Eval("Enabled") %>'
OnClick="lnkPage_Click"></asp:LinkButton>
</ItemTemplate>
</asp:Repeater>
The code that I am using to bind it:
int totalPages = totalRows / PageSize;
if (totalRows % PageSize != 0)
totalPages += 1;
List<ListItem> pages = new List<ListItem>();
if (totalPages > 1)
{
for (int i = 1; i <= totalPages; i++)
{
pages.Add(new ListItem(i.ToString(), i.ToString(), i != (PageIndex + 1)));
}
}
repeaterPaging.DataSource = pages;
repeaterPaging.DataBind();
and the output I am getting is:
which is not something I want. I want to have it something like:
1 2 3 4 5 ...
so that it should look somewhat pretty.
I don't have any idea to do it. Please help me out on this.