Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
        }
Exemplo n.º 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;
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }