I think there is a very old bug in PagingOptions in NearPageIndexes calculation class DistanceNearPageIndexesProvider function GetIndexes.
I have a page with bs:GridView and GridViewDataSet, TotalItemsCount = 235,
PagesCount = 12
PageSize = 20
Go to page number 12 through (bs:DataPager)
Change PageSize to = 200 and exception out of range fired in function GetIndexes
In short story if PageIndex>PagesCount then lastIndex < firstIndex a Enumerable.Range fires an exception !!
So i suggest a fix to this function and add following line of code at beginning
if (pagingOptions.PageIndex > pagingOptions.PagesCount) pagingOptions.PageIndex = pagingOptions.PagesCount - 1;
By the way, your blog on www.riganti.cz/ still getting first page, another bug of paging.
public IList<int> GetIndexes(IPagingOptions pagingOptions)
{
var firstIndex = Math.Max(pagingOptions.PageIndex - distance, 0);
var lastIndex = Math.Min(pagingOptions.PageIndex + distance + 1, pagingOptions.PagesCount);
return Enumerable //over here an exception !!!!!!!
.Range(firstIndex, lastIndex - firstIndex)
.ToList();
}
I think there is a very old bug in PagingOptions in NearPageIndexes calculation class DistanceNearPageIndexesProvider function GetIndexes.
I have a page with bs:GridView and GridViewDataSet, TotalItemsCount = 235, PagesCount = 12 PageSize = 20 Go to page number 12 through (bs:DataPager) Change PageSize to = 200 and exception out of range fired in function GetIndexes
In short story if PageIndex>PagesCount then lastIndex < firstIndex a Enumerable.Range fires an exception !! So i suggest a fix to this function and add following line of code at beginning
if (pagingOptions.PageIndex > pagingOptions.PagesCount) pagingOptions.PageIndex = pagingOptions.PagesCount - 1;
By the way, your blog on www.riganti.cz/ still getting first page, another bug of paging.