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

Grid Height

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Donald Norris
Top achievements
Rank 1
Donald Norris asked on 24 Oct 2011, 10:49 PM
        <telerik:RadGrid ID="RG1" runat="server" AutoGenerateColumns="False"
            CellSpacing="0" Width="540px">
            <ClientSettings EnablePostBackOnRowClick="true">
                <Selecting AllowRowSelect="True" />
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
            <MasterTableView GridLines="Both" Width="530" DataKeyNames="LCT_Code">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="LCT_Code"
            FilterControlAltText="Filter column column" HeaderText="Code"
            UniqueName="LCT_Code">
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="80px" />
            <ItemStyle Font-Bold="True" HorizontalAlign="Center" Width="80px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LCT_Desc"
            FilterControlAltText="Filter column1 column" HeaderText="Description"
            UniqueName="LCT_Desc">
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="200px" />
            <ItemStyle Font-Bold="True" HorizontalAlign="Left" Width="200px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LCT_WMLC"
            FilterControlAltText="Filter column2 column" HeaderText="WMLC"
            UniqueName="LCT_WMLC">
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="80px" />
            <ItemStyle Font-Bold="True" HorizontalAlign="Left" Width="80px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LCT_WLCM"
            FilterControlAltText="Filter column3 column" HeaderText="WLCM"
            UniqueName="LCT_WLCM">
            <HeaderStyle Font-Bold="True" HorizontalAlign="Center" Width="150px" />
            <ItemStyle Font-Bold="True" HorizontalAlign="Left" Width="150px" />
        </telerik:GridBoundColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
        </telerik:RadGrid>

I have a grid with only one row currently.  As you can see in the attached image the height of the grid is far greater than the one row.  How do I get the grid to only take up the needed space yet expand as required for new rows.  I have no height field in the definition.  Below is the grid definition.

Thanks,

 

  

 

 

 

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 Oct 2011, 05:19 AM
Hello Donald Norris,

You can set the ScrollHeight property appropriately.

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