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

How to change RadPivotGrid Page size combobox values ?

1 Answer 76 Views
PivotGrid
This is a migrated thread and some comments may be shown as answers.
Fabiana
Top achievements
Rank 1
Fabiana asked on 16 Sep 2015, 06:40 PM

Hi!

I am evaluating RadPivotGrid control...And I would like to know how to define my values in Page size combobox?

I saw thar added 10, 20 and 50 in this combo....

Thanks!

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Eyup
Telerik team
answered on 18 Sep 2015, 12:23 PM
Hi Fabiana,

You can achieve this requirement using the following approach:
protected void RadPivotGrid1_PreRender(object sender, EventArgs e)
{
    PivotGridPagerItem pager = RadPivotGrid1.GetItems(PivotGridItemType.PagerItem)[0] as PivotGridPagerItem;
    RadComboBox combo = pager.FindControl("PageSizeComboBox") as RadComboBox;
    combo.Items.Clear();
    List<int> pageSizes = new List<int>() { 10, 15, 30 };
    if (!pageSizes.Contains(RadPivotGrid1.PageSize))
    {
        pageSizes.Add(RadPivotGrid1.PageSize);
    }
    pageSizes.Sort();
    foreach (int pageSize in pageSizes)
    {
        combo.Items.Add(new RadComboBoxItem(pageSize.ToString(), pageSize.ToString()));
    }
    combo.SelectedValue = RadPivotGrid1.PageSize.ToString();
}

Hope this helps. Please give it a try and let me know if it works for you.

Regards,
Eyup
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
PivotGrid
Asked by
Fabiana
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or