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

Grid resizing on bind

1 Answer 37 Views
This is a migrated thread and some comments may be shown as answers.
Andrew Short
Top achievements
Rank 1
Andrew Short asked on 12 Feb 2009, 04:09 PM
I have recently upgraded a RadGrid from the ASP.NET version to the latest ASP.NET AJAX version.  I am running into some problems with sizing.  When the grid first loads, you can see the data and the grid looks normal for about a second.  Then, the grid 'gets squished', and I can only see half of the first row.  I am able to resize the grid with javascript to make it look normal, but then it has a flicker effect, and it looks even worse with the more records that are loaded. Below is my grid declaration and related javascript code.  I need for the grid to maintain its height when the page loads.  Does anyone know why it might be doing this?


<telerik:RadGrid ID="dgHistory" runat="server"















AutoGenerateColumns="False" >



<MasterTableView AllowSorting="true" AllowNaturalSort="true" EnableViewState="false" TableLayout="Auto" >



<HeaderStyle Width="100%" />



<ItemStyle Font-Size="X-Small" Font-Names="Arial" HorizontalAlign="Left" Wrap="True" BackColor="ActiveCaptionText" />



<AlternatingItemStyle Font-Size="X-Small" Font-Names="Arial" HorizontalAlign="Left" Wrap="True" BackColor="Control" />






<HeaderStyle Wrap="false" />






<Selecting AllowRowSelect="true" />



<Scrolling AllowScroll="true" SaveScrollPosition="true" UseStaticHeaders="true" />



<ClientEvents OnRowSelected="RowSelected" />



<Resizing EnableRealTimeResize="false" ResizeGridOnColumnResize="False" />






<GroupingSettings CaseSensitive="false" />






function Resize() {






var scrollArea = document.getElementById("<%= dgHistory.ClientID %>" + "_GridData");









var header = document.getElementById("<%= dgHistory.ClientID %>" + "_GridHeader"); = document.body.offsetHeight - (header.offsetHeight * 3.5) +

"px"; = document.body.offsetHeight - header.offsetHeight - 32 +



}, 200);






1 Answer, 1 is accepted

Sort by
Telerik team
answered on 16 Feb 2009, 04:22 PM

Hello Andrew,

How to set 100% Height/Width for your RadGrid for ASP.NET AJAX and resize the grid when its container is resized you can see from the sample project in the following code library entry:

Please use the approach from this article and let us know how it goes.

Kind regards,

the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Asked by
Andrew Short
Top achievements
Rank 1
Answers by
Telerik team
Share this question