Exemple #1
0
        /// <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);
        }
Exemple #2
0
 /// <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;
 }
Exemple #3
0
        /// <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;
        }
Exemple #4
0
 /// <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;
 }
Exemple #5
0
 /// <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);
 }
Exemple #6
0
 /// <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);
 }