Hey there,
I thought I'd jump on this one. I too encountered the same issue with > 9000 products in the same category. I modified the paging.aspx.cs codebehind to display correctly. It's still not 100% perfect but my client seems happy to accept this for now... here's what I did...
I modified the page_load handler as such:
/* ORIGINAL!!!
lblShowingTotals.Text = string.Format(LocalizationUtility.GetText("lblShowingTotals"), startNumber, endNumber, PagedDataSource.DataSourceCount);
pageLinks.InnerHtml = "";
for (int i = 0; i < PagedDataSource.PageCount; i++) {
if (PagedDataSource.CurrentPageIndex == i) {
pageLinks.InnerHtml += (i + 1) + " ";
}
else {
pageLinks.InnerHtml += string.Format(PAGING_BUTTON_TEMPLATE, isSearchPage ? ResolveUrl(GetSearchPagedUrl(searchTerms, i)) : ResolveUrl(GetCatalogPagedUrl(categoryId, i)), i + 1);
}
}
*/
int MaxForNow = 0;
bool MaxReached = false;
int MaxTotalPages = 0;if (PagedDataSource.PageCount > 20)
{
MaxForNow = 19;
MaxReached = true;
MaxTotalPages = ((PagedDataSource.PageCount / PagedDataSource.PageSize) / MaxForNow);
}
else
{
MaxForNow = PagedDataSource.PageCount;
}
if (MaxReached)
{
for (int i = PagedDataSource.CurrentPageIndex; i < (PagedDataSource.CurrentPageIndex + MaxForNow); i++)
{
if (i < ((PagedDataSource.CurrentPageIndex + MaxForNow) - 2))
{
if (PagedDataSource.CurrentPageIndex == i)
{
pageLinks.InnerHtml += (i + 1) + " ";
}
else
{
pageLinks.InnerHtml += string.Format(PAGING_BUTTON_TEMPLATE, isSearchPage ? ResolveUrl(GetSearchPagedUrl(searchTerms, i)) : ResolveUrl(GetCatalogPagedUrl(categoryId, i)), i + 1);
}
}
}
}
else
{
for (int i = 0; i < PagedDataSource.PageCount; i++)
{
if (PagedDataSource.CurrentPageIndex == i)
{
pageLinks.InnerHtml += (i + 1) + " ";
}
else
{
pageLinks.InnerHtml += string.Format(PAGING_BUTTON_TEMPLATE, isSearchPage ? ResolveUrl(GetSearchPagedUrl(searchTerms, i)) : ResolveUrl(GetCatalogPagedUrl(categoryId, i)), i + 1);
}
}
}
Hope this helps... I'm STILL working on it, but this should give you a tarting point.
da bibber