How to change RadPivotGrid Page size combobox values ?

2 posts, 1 answers
  1. Fabiana
    Fabiana avatar
    2 posts
    Member since:
    Sep 2015

    Posted 16 Sep 2015 Link to this post

    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!

     

  2. Answer
    Eyup
    Admin
    Eyup avatar
    3005 posts

    Posted 18 Sep 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top