private void BindItemsList() { List <ProductType> users = productTypeRepo.GetManagementProductTypes(ToSQL.EmptyNull(txtName.Text)); _PageDataSource.DataSource = users; _PageDataSource.AllowPaging = true; _PageDataSource.PageSize = 10; _PageDataSource.CurrentPageIndex = CurrentPage; ViewState["TotalPages"] = _PageDataSource.PageCount; //this.lblPageInfo.Text = "Results: " + ProductList.Count.ToString() + " Page " + (CurrentPage + 1) + " of " + _PageDataSource.PageCount + " "; this.btnPre.Visible = !_PageDataSource.IsFirstPage; this.btnNext.Visible = !_PageDataSource.IsLastPage; //this.lbtnFirst.Visible = !_PageDataSource.IsFirstPage; //this.lbtnLast.Visible = !_PageDataSource.IsLastPage; this.gvProductType.DataSource = _PageDataSource; this.gvProductType.DataBind(); this.gvProductType.UseAccessibleHeader = true; this.gvProductType.HeaderRow.TableSection = TableRowSection.TableHeader; this.doPaging(); }