Example #1
0
        private void CreatePageSizeControl(DataPagerFieldItem container)
        {
            container.Controls.Add(new LiteralControl("Show rows: "));

            var dd = new CommandDropDownList();

            dd.CommandName = "UpdatePageSize";

            dd.Items.Add(new ListItem("10"));
            dd.Items.Add(new ListItem("25"));
            dd.Items.Add(new ListItem("50"));
            dd.Items.Add(new ListItem("75"));
            dd.Items.Add(new ListItem("100"));
            dd.Items.Add(new ListItem("200"));

            var pageSizeItem = dd.Items.FindByValue(base.DataPager.PageSize.ToString());

            if (pageSizeItem == null)
            {
                pageSizeItem = new ListItem(DataPager.PageSize.ToString());
                dd.Items.Insert(0, pageSizeItem);
            }

            pageSizeItem.Selected = true;
            container.Controls.Add(dd);

            AddNonBreakingSpace(container);
            AddNonBreakingSpace(container);
        }
Example #2
0
        private void CreatePageSizeControl(DataPagerFieldItem container)
        {
            container.Controls.Add(new LiteralControl("Show rows: "));

            var dd = new CommandDropDownList();

            dd.CommandName = "UpdatePageSize";

            dd.Items.Add(new ListItem("10"));
            dd.Items.Add(new ListItem("25"));
            dd.Items.Add(new ListItem("50"));
            dd.Items.Add(new ListItem("75"));
            dd.Items.Add(new ListItem("100"));
            dd.Items.Add(new ListItem("200"));

            var pageSizeItem = dd.Items.FindByValue(base.DataPager.PageSize.ToString());

            if (pageSizeItem == null)
            {
                pageSizeItem = new ListItem(DataPager.PageSize.ToString());
                dd.Items.Insert(0, pageSizeItem);
            }

            pageSizeItem.Selected = true;
            container.Controls.Add(dd);

            AddNonBreakingSpace(container);
            AddNonBreakingSpace(container);
        }