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

Grid re-sizing when page size is changed

1 Answer 62 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 15 Dec 2011, 08:13 PM

When I change the "Page Size" from 10 to 20 the grid does not re-size to show all 20 and the nav bar. It scrolls the grid. I need the horizonal scroll bar as i display many items. I would like it to display all 20 items without scrolling.

<telerik:RadGrid AutoGenerateColumns="False" ID="grdPendingAuths" AllowSorting="True" AllowPaging="True" PagerStyle-AlwaysVisible="True" PagerStyle-Position="Bottom" PageSize="10"
    GridLines="Both" Skin="WebBlue" EnableEmbeddedSkins="false" BorderColor="#0066B3"
    BorderWidth="2" OnSortCommand="grdPendingAuths_SortCommand" OnNeedDataSource="grdPendingAuths_OnNeedDataSource"
    Width="9in" runat="server" CellSpacing="0">
    <ClientSettings>
        <Scrolling AllowScroll="true" UseStaticHeaders="false" SaveScrollPosition="false">
        </Scrolling>
        <ClientEvents OnGridCreated="GridCreated" />
    </ClientSettings>
    <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true" />
    <MasterTableView TableLayout="Auto" Width="9in" AllowNaturalSort="false" >
        <Columns>
            <telerik:GridBoundColumn HeaderText="Status" DataField="ApprovalStatus" UniqueName="ApprovalStatus"
                SortExpression="ApprovalStatus" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="False"
                ShowSortIcon="False" ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Originator" DataField="CreatedBy" UniqueName="CreatedBy"
                SortExpression="CreatedBy" ItemStyle-Wrap="False" ShowSortIcon="False" ShowFilterIcon="False"
                ReadOnly="True" AllowFiltering="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="MemberID" DataField="MemberID" UniqueName="MemberID"
                SortExpression="MemberID" Visible="False" ShowSortIcon="False" ShowFilterIcon="False"
                ReadOnly="True" AllowFiltering="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Member Name" DataField="Member Name" UniqueName="MemberName"
                SortExpression="Member Name" ItemStyle-Wrap="False" ShowSortIcon="False" ShowFilterIcon="False"
                ReadOnly="True" AllowFiltering="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="AuthID" DataField="AuthID" UniqueName="AuthID"
                SortExpression="AuthID" Visible="False" ShowSortIcon="False" ShowFilterIcon="False"
                ReadOnly="True" AllowFiltering="False">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Auth #" DataField="AuthNumber" UniqueName="AuthNumber"
                SortExpression="AuthNumber" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width=".75in"
                ShowSortIcon="False" ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False">
                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Adj #" DataField="AuthAmendment" UniqueName="AuthAmendment"
                SortExpression="AuthAmendment" ItemStyle-Wrap="False" HeaderStyle-Width=".3in"
                ItemStyle-HorizontalAlign="Right" DataFormatString="{0:#0}" ShowSortIcon="False"
                ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False" DataType="System.Int32"
                HeaderStyle-HorizontalAlign="Center">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Start Date" DataField="StartDate" UniqueName="StartDate"
                SortExpression="StartDate" DataType="System.DateTime" HeaderStyle-Width=".65in"
                ItemStyle-Wrap="False" DataFormatString="{0:MM/dd/yyyy}" ShowSortIcon="False"
                ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False" HeaderStyle-HorizontalAlign="Center">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="End Date" DataField="EndDate" UniqueName="EndDate"
                SortExpression="EndDate" DataType="System.DateTime" HeaderStyle-Width=".65in"
                ItemStyle-Wrap="False" DataFormatString="{0:MM/dd/yyyy}" ShowSortIcon="False"
                ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False" HeaderStyle-HorizontalAlign="Center">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Max Units" DataField="MaxUnits" UniqueName="MaxUnits"
                SortExpression="MaxUnits" ItemStyle-Wrap="False" HeaderStyle-Width=".3in" DataType="System.Int32"
                DataFormatString="{0:###,##0}" ItemStyle-HorizontalAlign="Right" ShowSortIcon="False"
                ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False" HeaderStyle-HorizontalAlign="Center">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Division" DataField="Division" UniqueName="Division"
                SortExpression="Division" ItemStyle-Wrap="False" HeaderStyle-Width=".5in" ShowSortIcon="False"
                ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False" ItemStyle-HorizontalAlign="Center"
                HeaderStyle-HorizontalAlign="Center">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn HeaderText="Service Description" DataField="Service Description"
                UniqueName="ServiceDescription" SortExpression="Service Description" ShowSortIcon="False"
                ShowFilterIcon="False" ReadOnly="True" AllowFiltering="False" ItemStyle-Wrap="False">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 16 Dec 2011, 01:04 PM
Hi John,

To achieve your goal you could set ScrollHeight property to empty string as shown below:
<ClientSettings>
           <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="">
           </Scrolling>
       </ClientSettings>

Kind regards,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or