This is a migrated thread and some comments may be shown as answers.

Custom PageSize

2 Answers 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Madrinha
Top achievements
Rank 1
Madrinha asked on 14 Apr 2010, 05:53 PM
Hi,

I had this code to add some custom page size on RadGrid:

  protected void RadGridInvoiceList_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridPagerItem)
        {
            RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
            PageSizeCombo.Items.Clear();

            PageSizeCombo.Items.Add(new RadComboBoxItem("10", "10"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("20", "20"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("300", "300"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("400", "400"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("500", "500"));
            PageSizeCombo.Items.Add(new RadComboBoxItem("1000", "1000"));

            PageSizeCombo.Items.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;

            PageSizeCombo.DropDownWidth = Unit.Pixel(60);
            PageSizeCombo.AutoPostBack = true;
        }
}

.....

protected void RadGridInvoiceList_Load(object sender, EventArgs e)
    {
        GridItem[] pagers = this.RadGridInvoiceList.MasterTableView.GetItems(GridItemType.Pager);

        foreach (GridItem pager in pagers)
        {
            RadComboBox comboBox = (RadComboBox)pager.FindControl("PageSizeComboBox");

            comboBox.SelectedIndexChanged += delegate(object _source, RadComboBoxSelectedIndexChangedEventArgs _e)
            {
                RadGridInvoiceList.MasterTableView.PageSize = Convert.ToInt32(_e.Value);
                RadGridInvoiceList.Rebind();
            };
        }
    }

For some reason after upgrading to 2010. Q1 stop working. I've also try the latest Build Release but the behaviour is the same. Dows the ajax refresh but the pagesize remains the same.

Thanks
Eduardo Barbosa


2 Answers, 1 is accepted

Sort by
0
Madrinha
Top achievements
Rank 1
answered on 15 Apr 2010, 10:18 AM
Hi,

Never mind this one. Seems to be back to work. Deleted all Telerik dll on bin and add the all back again.

Thanks
Eduardo
0
Pavlina
Telerik team
answered on 15 Apr 2010, 12:18 PM
Hi Eduardo,

I am glad that you solved the problem, in case you experience any other problems, please do not hesitate to contact us.

Greetings,
Pavlina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Madrinha
Top achievements
Rank 1
Answers by
Madrinha
Top achievements
Rank 1
Pavlina
Telerik team
Share this question
or