翻页中改变每页记录数后当前页面起始页问题

Main Function:

    /**
     * Calculate the new page index when items per page changed
     * 
@param currentPageIndex Current Page Index
     * 
@param currentRowsPerPage Current Rows Per Page
     * 
@param newRowsPerPage New Rows Per Page
     * 
@return New page index.
     
*/
    
private int newPageIndex(int currentPageIndex, int currentRowsPerPage, int newRowsPerPage)
    {
        
int currentTopIndex = (currentPageIndex-1)*currentRowsPerPage+1;
        
int newPageIndex = currentTopIndex%newRowsPerPage > 0 ? 
                (currentTopIndex
/newRowsPerPage)+1:
                currentTopIndex
/newRowsPerPage;
        
return newPageIndex;
    }
原文地址:https://www.cnblogs.com/zenghanxi/p/1437967.html