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;
    }

 

 

相关文章:

  • 2021-12-22
  • 2021-09-28
  • 2022-12-23
  • 2021-08-07
  • 2021-07-19
  • 2022-02-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-21
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-01-12
  • 2022-01-04
相关资源
相似解决方案