This is a migrated thread and some comments may be shown as answers.
AllowCustomPaging set to false not working (for me)
1 Answer 10 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
peter asked on 03 Apr 2011, 08:06 PM
Hi There,
I have a simple grid with a datasource. All ok, except that I dont want the user be able to set 
the page size. But setting the AllowCustomPaging to false doesnt do much.... It still shows the page-size
drop down and user is able to use it too. Any tips somebody?

Cheers Peter.

div class='Kamer_03'>03
<telerik:RadGrid ID="RadGrid1" runat="server"
        DataSourceID="SqlDataSource1" GridLines="Vertical"
        AutoGenerateColumns="False" BackColor="#FF3399"
        PageSize="5" AllowPaging = "True" AllowCustomPaging="false"  >
<MasterTableView datasourceid="SqlDataSource1" >
<HeaderStyle Width="20px"></HeaderStyle>
<HeaderStyle Width="30px"></HeaderStyle>
        <telerik:GridBoundColumn DataField="TRIA" HeaderText="TRIA"
            SortExpression="TRIA" UniqueName="TRIA" ReadOnly="True">
        <telerik:GridBoundColumn DataField="PATIENT" HeaderText="PATIENT"
            UniqueName="PATIENT" ReadOnly="True" SortExpression="PATIENT">
        <telerik:GridBoundColumn DataField="SPEC" HeaderText="SPEC" UniqueName="SPEC"
            ReadOnly="True" SortExpression="SPEC">
        <telerik:GridBoundColumn DataField="NURSE" HeaderText="NURSE"
            UniqueName="NURSE" ReadOnly="True" SortExpression="NURSE">
        <telerik:GridBoundColumn DataField="HB" HeaderText="HB" ReadOnly="True"
            SortExpression="HB" UniqueName="HB">
        <telerik:GridBoundColumn DataField="WAIT" HeaderText="WAIT" UniqueName="WAIT"
            ReadOnly="True" SortExpression="WAIT">
    <PagerStyle PageSizeLabelText="" ShowPagerText="False" />
    <asp:SqlDataSource ID="SqlDataSource1"
        ConnectionString="<%$ ConnectionStrings:SEH-acceptatieConnectionString %>"
        SelectCommand="usp_ShowPatients" SelectCommandType="StoredProcedure">
            <asp:Parameter DefaultValue="O3" Name="Ruimte" Type="String" />

1 Answer, 1 is accepted

Sort by
Top achievements
Rank 1
answered on 04 Apr 2011, 04:06 AM
Hello Peter,

In order to hide the Pagesize ComboBox in PagerItem, try the following code snippet.

protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
       if (e.Item is GridPagerItem)
           RadComboBox combo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
           combo.Visible = false;

Also refer the following documentation which describes how to access the controls inside Pager.
Accessing the elements of advanced type pager

Asked by
Top achievements
Rank 1
Answers by
Top achievements
Rank 1
Share this question