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

[Solved] Turning on Scrolling breaks the grid autoresize

2 Answers 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 03 May 2013, 06:44 PM
My telerik grid below works just fine. However once I add the below code to enable scrolling the grid no longer re sizes correctly.
<ClientSettings>
      <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True"/>
</ClientSettings>


It now has a large amount of space between the last row in the grid and the footer or bottom of the grid?

Here is my code:
<head runat="server">
    <link rel="Stylesheet" type="text/css" href="./Styles.css" />
    <title>Content Tracker</title>
</head>
<body class="body">
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
     
    <!-- Page Header -->
        <div class="header">
            <table width="1000px">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
                                    <img alt="" src="./Images/xxxxx_Logo_Small.gif" />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td style="float: right">
                        <table border="0">
                            <tr>
                                <td>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <b>Welcome <asp:Label ID="loggedInUser" runat="server" /></b>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
         
        <div id="Nav" class="nav"></div>
        <div id="spacer" class="divSpacer"></div>
 
    <!-- Page Content -->
    <div id="content" class="content" >
 
    <telerik:RadGrid ID="RadGrid1" Width="990" runat="server" DataSourceID="EntityDataSourceAssignments"
        AllowPaging="True" AllowAutomaticUpdates="True" AllowAutomaticInserts="True" GridLines="Both"
        AllowAutomaticDeletes="true" AllowSorting="true"
        OnItemCreated="RadGrid1_ItemCreated" OnItemInserted="RadGrid1_ItemInserted" OnPreRender="RadGrid1_PreRender">
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView DataSourceID="EntityDataSourceAssignments" AutoGenerateColumns="False"
            DataKeyNames="AssignmentsID" CommandItemDisplay="Top">
            <Columns>
                <telerik:GridBoundColumn DataField="JurisdictionCode" HeaderText="Jurisdiction Code" SortExpression="JurisdictionCode"
                    UniqueName="JurisdictionCode" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ObligationName" HeaderText="Obligation Name" SortExpression="ObligationName"
                    UniqueName="ObligationName" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DevTeamLead" HeaderText="Dev Team Lead" SortExpression="DevTeamLead"
                    UniqueName="DevTeamLead" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Developer" HeaderText="Developer" SortExpression="Developer"
                    UniqueName="Developer" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="TestTeamLead" HeaderText="Test Team Lead" SortExpression="TestTeamLead"
                    UniqueName="TestTeamLead" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="DueDate" HeaderText="Due Date" SortExpression="DueDate"
                    UniqueName="DueDate" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="FormsReceived" HeaderText="Forms Received" SortExpression="FormsReceived"
                    UniqueName="FormsReceived" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="EfileComplete" HeaderText="Efile Complete" SortExpression="EfileComplete"
                    UniqueName="EfileComplete" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="ESEXTStatus" HeaderText="ES-EXT Status" SortExpression="ESEXTStatus"
                    UniqueName="ESEXTStatus" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="SubmittalStatus" HeaderText="Submittal Status" SortExpression="SubmittalStatus"
                    UniqueName="SubmittalStatus" Visible="true">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Priority" HeaderText="Priority" SortExpression="Priority"
                    UniqueName="Priority" Visible="true">
                </telerik:GridBoundColumn>
 
                <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
            </Columns>
            <EditFormSettings>
                <EditColumn ButtonType="ImageButton" />
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="True">
            </Scrolling>
        </ClientSettings>
    </telerik:RadGrid>
    <asp:EntityDataSource ID="EntityDataSourceAssignments" runat="server" ConnectionString="name=ContentTrackerEntities"
        DefaultContainerName="ContentTrackerEntities" EntitySetName="Assignments" EnableUpdate="True" EnableDelete="True" EnableInsert="True">
    </asp:EntityDataSource>
    </div>
 
    <div id="page-footer">
        <div id="page-footer-copyright">Copyright © 2010-2012 xxxxxx. All rights reserved.</div>
    </div>
 
    </form>

2 Answers, 1 is accepted

Sort by
0
Accepted
Galin
Telerik team
answered on 08 May 2013, 03:23 PM
Hi Julian,

When the scroll is enabled the RadGrid has default setting ScrollHeight="300px". For more information please refer to this help topic.

However, you can autoresize the RadGrid by setting the ScrollHeight to empty string, e.g.
<ClientSettings>
    <Scrolling AllowScroll="true" UseStaticHeaders="True" SaveScrollPosition="True" ScrollHeight=""></Scrolling>
</ClientSettings>

I hope this helps.

Greetings,
Galin
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.
0
Julian
Top achievements
Rank 1
answered on 08 May 2013, 04:25 PM
This works perfectly. Thank you!
Tags
Grid
Asked by
Julian
Top achievements
Rank 1
Answers by
Galin
Telerik team
Julian
Top achievements
Rank 1
Share this question
or