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

Page Sizes

1 Answer 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
marco
Top achievements
Rank 2
marco asked on 16 Oct 2009, 10:51 AM
Hello Developers,

Does anyone know if it's possible to add/chenge the page size options?
by default we have 10,20,50 and if i'd like to put also 70 and 100?

many thanks

cheers,
marco

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 16 Oct 2009, 11:43 AM
Hi Marco,

You can try out the following approach to show customized options for radgrid PageSize dropdown.

ASPX:
 
<telerik:RadGrid ID="RadGrid1" runat="server" AllowMultiRowSelection="true" AllowPaging="True" DataSourceID="SqlDataSource1"
    <MasterTableView AutoGenerateColumns="False" PageSize="10" DataSourceID="SqlDataSource1"
        <PagerStyle Mode="NextPrevAndNumeric" /> 
        <Columns> 
         
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 

C#:
 
  
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
{  
    if (e.Item is GridPagerItem)  
    {  
        RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");  
        PageSizeCombo.Items[0].Text = "10";  
        PageSizeCombo.Items[1].Text = "20";  
        PageSizeCombo.Items[2].Text = "50";  
        PageSizeCombo.Items[2].Text = "70";  
        PageSizeCombo.Items[2].Text = "100";  
        PageSizeCombo.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;   
    }  
}  
 

Thanks,
Princy.
Tags
Grid
Asked by
marco
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Share this question
or