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

RadGrid with scroll and fixed size

1 Answer 183 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adam Cole
Top achievements
Rank 1
Adam Cole asked on 12 Feb 2009, 04:21 PM
Hi,
  I am using radGrid in ASPNET AJAX Q3 2008.  The enable the scrolling and changed my grid height to 200px, everything looks fine.  But whenever there is a postback on the page, the grid goes back to its original size, then changes back to 200px right away.  Is it a glitch of the grid or I missed something?

Wesley


Here is my code. It's a very simple page.

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TelerikGrid._Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1"
            GridLines="None" Height="200px">
<MasterTableView AutoGenerateColumns="False" DataKeyNames="ID"
                DataSourceID="SqlDataSource1">
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"
            ReadOnly="True" SortExpression="ID" UniqueName="ID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="StudyID" DataType="System.Int32"
            HeaderText="StudyID" SortExpression="StudyID" UniqueName="StudyID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="FormTypeID" DataType="System.Int32"
            HeaderText="FormTypeID" SortExpression="FormTypeID" UniqueName="FormTypeID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="FormName" HeaderText="FormName"
            SortExpression="FormName" UniqueName="FormName">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>

            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>



        </telerik:RadGrid>
        <br />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:ConnStrP4EDC %>"
            SelectCommand="SELECT [ID], [StudyID], [FormTypeID], [FormName] FROM [Forms]">
        </asp:SqlDataSource>
        <asp:Button ID="Button1" runat="server" Text="Button" />
    </div>
    </form>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Adam Cole
Top achievements
Rank 1
answered on 12 Feb 2009, 04:59 PM
Hi,
  I found my solution after some digging.  I set ScrollHeight to 10px and it fixed the glitch problem.

<ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="10px"  />
</ClientSettings>
Tags
Grid
Asked by
Adam Cole
Top achievements
Rank 1
Answers by
Adam Cole
Top achievements
Rank 1
Share this question
or