/// <summary> /// Returns the grid view pager /// </summary> /// <param name="gridViewState"></param> /// <returns></returns> public static GridViewPager GetGridViewPager(GridViewState gridViewState) { GridViewPager gridViewPager = new GridViewPager(); if (gridViewState.RequestedPageIndex > 0) { gridViewPager.CurrentPageIndex = gridViewState.RequestedPageIndex; } else if (gridViewState.RequestedPageIndex == 0 && gridViewState.CurrentPageIndex != 0) { gridViewPager.CurrentPageIndex = gridViewState.CurrentPageIndex; } else { gridViewPager.CurrentPageIndex = 1; } gridViewPager.PageSize = AppConstantsUtility.ReadDefaultValueIfEmpty <int>(AppConstants.ConfigurationKeys.GridPageSize, GridViewConstants.DefaultGridPageSize); gridViewPager.MaximumNumberOfVisiblePages = AppConstantsUtility.ReadDefaultValueIfEmpty <int>( AppConstants.ConfigurationKeys.GridMaximumNumberOfVisiblePages, GridViewConstants.DefaultGridMaxVisiblePages); return(gridViewPager); }
/// <summary> /// Returns the grid view pager start index /// </summary> /// <param name="gridViewPager"></param> /// <returns></returns> public static int GetStartRowIndex(GridViewPager gridViewPager) { return (gridViewPager.PageSize * (gridViewPager.CurrentPageIndex - 1)) + 1; }
/// <summary> /// Returns the grid view pager /// </summary> /// <param name="gridViewState"></param> /// <returns></returns> public static GridViewPager GetGridViewPager(GridViewState gridViewState) { GridViewPager gridViewPager = new GridViewPager(); if (gridViewState.RequestedPageIndex > 0) { gridViewPager.CurrentPageIndex = gridViewState.RequestedPageIndex; } else if (gridViewState.RequestedPageIndex == 0 && gridViewState.CurrentPageIndex != 0) { gridViewPager.CurrentPageIndex = gridViewState.CurrentPageIndex; } else { gridViewPager.CurrentPageIndex = 1; } gridViewPager.PageSize = AppConstantsUtility.ReadDefaultValueIfEmpty<int>(AppConstants.ConfigurationKeys.GridPageSize, GridViewConstants.DefaultGridPageSize); gridViewPager.MaximumNumberOfVisiblePages = AppConstantsUtility.ReadDefaultValueIfEmpty<int>( AppConstants.ConfigurationKeys.GridMaximumNumberOfVisiblePages, GridViewConstants.DefaultGridMaxVisiblePages); return gridViewPager; }
/// <summary> /// Returns the grid view pager end index /// </summary> /// <param name="gridViewPager"></param> /// <returns></returns> public static int GetEndRowIndex(GridViewPager gridViewPager) { return gridViewPager.PageSize * gridViewPager.CurrentPageIndex; }
/// <summary> /// Returns the grid view pager end index /// </summary> /// <param name="gridViewPager"></param> /// <returns></returns> public static int GetEndRowIndex(GridViewPager gridViewPager) { return(gridViewPager.PageSize * gridViewPager.CurrentPageIndex); }
/// <summary> /// Returns the grid view pager start index /// </summary> /// <param name="gridViewPager"></param> /// <returns></returns> public static int GetStartRowIndex(GridViewPager gridViewPager) { return((gridViewPager.PageSize * (gridViewPager.CurrentPageIndex - 1)) + 1); }