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

Page size for parent grid

2 Answers 70 Views
Grid
This is a migrated thread and some comments may be shown as answers.
muki
Top achievements
Rank 1
muki asked on 23 Oct 2014, 01:39 PM
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 Answers, 1 is accepted

Sort by
0
muki
Top achievements
Rank 1
answered on 26 Oct 2014, 12:23 PM
Anyone ?
0
Jayesh Goyani
Top achievements
Rank 2
answered on 26 Oct 2014, 06:20 PM
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
Tags
Grid
Asked by
muki
Top achievements
Rank 1
Answers by
muki
Top achievements
Rank 1
Jayesh Goyani
Top achievements
Rank 2
Share this question
or