Page size for parent grid

3 posts, 0 answers
  1. muki
    muki avatar
    2 posts
    Member since:
    Oct 2014

    Posted 23 Oct 2014 Link to this post

    I have a grid kind of similar the demo at:
    http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/hierarchy-with-templates/defaultcs.aspx

    I am using NestedViewTemplate.
    My problem is that the same as the url above,
    I have no issues to have a page size combobox for the nested view,
    But cannot make have page size to the parent grid.

    Is it a grid limit - or is there are way?
    I am trying to use:
               <PagerStyle Mode="NextPrevAndNumeric" PageSizeLabelText="Page Size: "PageSizes="5,10,25,50,100,250" />
    but see no combobox.
  2. muki
    muki avatar
    2 posts
    Member since:
    Oct 2014

    Posted 26 Oct 2014 in reply to muki Link to this post

    Anyone ?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 26 Oct 2014 in reply to muki Link to this post

    Hi,

    Please try with the below code snippet.

    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridPagerItem)
        {
            GridPagerItem pagerItem = (GridPagerItem)e.Item;
            RadComboBox pageSizeCombo = (RadComboBox)pagerItem.FindControl("PageSizeComboBox");
            pageSizeCombo.Items.Clear();
     
            RadComboBoxItem item = new RadComboBoxItem();
            item = new RadComboBoxItem("5", "5");
            item.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
            pageSizeCombo.Items.Add(item);
     
            item = new RadComboBoxItem("10", "10");
            item.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
            pageSizeCombo.Items.Add(item);
     
            item = new RadComboBoxItem("25", "25");
            item.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
            pageSizeCombo.Items.Add(item);
     
            item = new RadComboBoxItem("50", "50");
            item.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID);
            pageSizeCombo.Items.Add(item);
     
            pageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
        }
    }


    Let me know if any concern.

    Please check this link for more information.

    Thanks,
    Jayesh Goyani
Back to Top