Page Sizes

2 posts, 1 answers
  1. marco
    marco avatar
    33 posts
    Member since:
    Sep 2007

    Posted 16 Oct 2009 Link to this post

    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
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Oct 2009 Link to this post

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