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

AllowCustomPaging set to false not working (for me)

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
peter
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" >
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn>
<HeaderStyle Width="30px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="TRIA" HeaderText="TRIA"
            SortExpression="TRIA" UniqueName="TRIA" ReadOnly="True">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="PATIENT" HeaderText="PATIENT"
            UniqueName="PATIENT" ReadOnly="True" SortExpression="PATIENT">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="SPEC" HeaderText="SPEC" UniqueName="SPEC"
            ReadOnly="True" SortExpression="SPEC">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="NURSE" HeaderText="NURSE"
            UniqueName="NURSE" ReadOnly="True" SortExpression="NURSE">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="HB" HeaderText="HB" ReadOnly="True"
            SortExpression="HB" UniqueName="HB">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="WAIT" HeaderText="WAIT" UniqueName="WAIT"
            ReadOnly="True" SortExpression="WAIT">
        </telerik:GridBoundColumn>
 
    </Columns>
</MasterTableView>
 
 
    <PagerStyle PageSizeLabelText="" ShowPagerText="False" />
 
 
    </telerik:RadGrid>
    <asp:SqlDataSource ID="SqlDataSource1"
        runat="server"
        ConnectionString="<%$ ConnectionStrings:SEH-acceptatieConnectionString %>"
         
        SelectCommand="usp_ShowPatients" SelectCommandType="StoredProcedure">
        <SelectParameters>
            <asp:Parameter DefaultValue="O3" Name="Ruimte" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    </div>

1 Answer, 1 is accepted

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

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

C#:
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

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