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

Excess 300px height in GridData section

3 Answers 440 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rod Campbell
Top achievements
Rank 1
Rod Campbell asked on 23 Mar 2010, 01:14 AM

When the RadGrid is rendered, the RadGrid_GridData section has a seemingly excess 300px height:

     <div id="ctl00_ContentPlaceHolder2_RadGrid1_GridData" class="rgDataDiv"
                                                style="position:relative;overflow:auto;width:100%;height:300px;">

An example of this can be seen in the Telerik webmail demo at http://demos.telerik.com/webmail/.

This excess item limits changes that might be made post-rendering, so it would best be removed if it isn't adding anything to the result.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 23 Mar 2010, 10:27 AM
Hi Rod,

Scrollable containers should always have some explicit width / height, otherwise the browser will not know when to display scrollbars. If you want RadGrid to resize according to its content, please disable scrolling. If you want the control to be scrollable horizontally, but not vertically, you can use the following CSS rule:

.rgDataDiv
{
         height: auto !important ;
}

(Do not set any height to RadGrid in this case)


Kind 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.
0
Rod Campbell
Top achievements
Rank 1
answered on 24 Mar 2010, 01:02 AM
The CSS override provides a good workaround. Any reason for 300px? How about 100%, like the default width? Thanks.
0
Dimo
Telerik team
answered on 24 Mar 2010, 09:19 AM
Hello Rod,

The Grid scrollable area cannot be 100% hight for two reasons:

1. The container has sibling elements and if it becomes 100% high, the sibligns will overflow
2. Containers with percentage heights require their parents to have explicit height. Since this is rarely the case, the height will not work at all. In general, the web and web standards were designed with the idea that most content will flow and occupy only the (vertical) space it needs, not more.

That's why the RadGrid data area has a default pixel height.

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
Rod Campbell
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Rod Campbell
Top achievements
Rank 1
Share this question
or