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

100% Height inside variable height div

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nam Nguyen
Top achievements
Rank 1
Nam Nguyen asked on 07 Aug 2010, 12:59 AM
Hello,

My page has 3 sections, header, footer, and content - where the grid should take 100% height).

The grid has scrolling with static header.

I want the grid to take the full height of the middle div. And the height should work with browser/pane resizing.

It works fine in Firefox and Chrome. But in IE7 the grid is squashed up.

Here is my code.

Thanks a lot in advance!
==============================================================================
<%@ Page Language="C#" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<!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">
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <title>RadGrid for ASP.NET</title>
    <style type="text/css">
        html
        {
            overflow: auto;
        }
        html, body, form
        {
            margin: 0;
            height: 100%;
        }
        .header
        {
            height: 50px;
        }
        .container
        {
            position: absolute;
            top: 50px;
            bottom: 50px;
            width: 100%;
        }
        .footer
        {
            position: absolute;
            bottom: 0;
            height: 50px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div class="header">
        </div>
        <div class="container">
            <rad:RadGrid ID="RadGrid1" runat="server" DataSourceID="XmlDataSource1" AllowPaging="true"
                PageSize="40" Width="100%" Height="100%" Style="border: 0; outline: none">
                <MasterTableView TableLayout="Fixed" />
                <ClientSettings>
                    <Selecting AllowRowSelect="true" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
            </rad:RadGrid>
        </div>
        <div class="footer">
        </div>
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/datasource.xml" />
    </form>
</body>
</html>

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 10 Aug 2010, 11:59 AM
Hello Nam,

Please avoid posting a forum thread and a support ticket about the same thing.

Your implementation using absolute positioning is not supported well by all browsers, hence the problem. You can use a RadSplitter-based layout to achieve the desired behavior. Please refer to your support ticket on the matter.

Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Nam Nguyen
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or