private void BindGrid() { List <ContentStyle> styles = ContentStyle.GetPage(siteSettings.SiteGuid, pageNumber, pageSize, out totalPages); string pageUrl = SiteRoot + "/Admin/ContentStyles.aspx?pagenumber={0}"; pgrTop.PageURLFormat = pageUrl; pgrTop.ShowFirstLast = true; pgrTop.CurrentIndex = pageNumber; pgrTop.PageSize = pageSize; pgrTop.PageCount = totalPages; pgrTop.Visible = (totalPages > 1); pgrBottom.PageURLFormat = pageUrl; pgrBottom.ShowFirstLast = true; pgrBottom.CurrentIndex = pageNumber; pgrBottom.PageSize = pageSize; pgrBottom.PageCount = totalPages; pgrBottom.Visible = (totalPages > 1); grdStyles.DataSource = styles; grdStyles.DataBind(); if (styles.Count() <= 0) { btnExportStyles.Enabled = false; } }