/// <summary> /// Creates the page size control. /// </summary> /// <param name="container">The container.</param> private void CreatePageSizeControl(DataPagerFieldItem container) { var pageSizeDropDownList = new ButtonDropDownList { CommandName = "UpdatePageSize", CssClass = "form-control" }; pageSizeDropDownList.Items.Add(new ListItem("5", "5")); pageSizeDropDownList.Items.Add(new ListItem("10", "10")); pageSizeDropDownList.Items.Add(new ListItem("15", "15")); pageSizeDropDownList.Items.Add(new ListItem("25", "25")); pageSizeDropDownList.Items.Add(new ListItem("50", "50")); pageSizeDropDownList.Items.Add(new ListItem("75", "75")); pageSizeDropDownList.Items.Add(new ListItem("100", "100")); var pageSizeItem = pageSizeDropDownList.Items.FindByValue(DataPager.PageSize.ToString()); if (pageSizeItem == null) { pageSizeItem = new ListItem(DataPager.PageSize.ToString(), DataPager.PageSize.ToString()); pageSizeDropDownList.Items.Insert(0, pageSizeItem); } pageSizeItem.Selected = true; container.Controls.Add(pageSizeDropDownList); container.Controls.Add(new LiteralControl(string.Format("<span>{0}</span>", _PerPage))); }
/// <summary> /// Creates the page size control. /// </summary> /// <param name="container">The container.</param> private void CreatePageSizeControl(DataPagerFieldItem container) { container.Controls.Add(new LiteralControl("Show rows: ")); ButtonDropDownList pageSizeDropDownList = new ButtonDropDownList(); pageSizeDropDownList.CommandName = "UpdatePageSize"; pageSizeDropDownList.Items.Add(new ListItem("5", "5")); pageSizeDropDownList.Items.Add(new ListItem("10", "10")); pageSizeDropDownList.Items.Add(new ListItem("15", "15")); pageSizeDropDownList.Items.Add(new ListItem("25", "25")); pageSizeDropDownList.Items.Add(new ListItem("50", "50")); pageSizeDropDownList.Items.Add(new ListItem("75", "75")); pageSizeDropDownList.Items.Add(new ListItem("100", "100")); ListItem pageSizeItem = pageSizeDropDownList.Items.FindByValue(base.DataPager.PageSize.ToString()); if (pageSizeItem == null) { pageSizeItem = new ListItem(base.DataPager.PageSize.ToString(), base.DataPager.PageSize.ToString()); pageSizeDropDownList.Items.Insert(0, pageSizeItem); } pageSizeItem.Selected = true; container.Controls.Add(pageSizeDropDownList); this.AddNonBreakingSpace(container); this.AddNonBreakingSpace(container); }
/// <summary> /// Creates the page size control. /// </summary> /// <param name="container">The container.</param> private void CreatePageSizeControl(DataPagerFieldItem container) { var pageSizeDropDownList = new ButtonDropDownList { CommandName = "UpdatePageSize", CssClass = "form-control"}; pageSizeDropDownList.Items.Add(new ListItem("5", "5")); pageSizeDropDownList.Items.Add(new ListItem("10", "10")); pageSizeDropDownList.Items.Add(new ListItem("15", "15")); pageSizeDropDownList.Items.Add(new ListItem("25", "25")); pageSizeDropDownList.Items.Add(new ListItem("50", "50")); pageSizeDropDownList.Items.Add(new ListItem("75", "75")); pageSizeDropDownList.Items.Add(new ListItem("100", "100")); var pageSizeItem = pageSizeDropDownList.Items.FindByValue(DataPager.PageSize.ToString()); if (pageSizeItem == null) { pageSizeItem = new ListItem(DataPager.PageSize.ToString(), DataPager.PageSize.ToString()); pageSizeDropDownList.Items.Insert(0, pageSizeItem); } pageSizeItem.Selected = true; container.Controls.Add(pageSizeDropDownList); container.Controls.Add(new LiteralControl(string.Format("<span>{0}</span>", _PerPage))); }