Is there a way to ensure that the RadGrid control height is always 100% of the datasource content?
For example, if there are only 3 rows in the grid, the height of the grid control would only be as tall as the three rows in the datasource plus the header row. All controls on the page below the grid would be displayed directly below the grid.
If the datasource of the grid changed so that the results contained 15 rows, the height of the grid would change to show all 15 rows, and again, any controls on the page below the grid would show directly below the results.
Thanks.
For example, if there are only 3 rows in the grid, the height of the grid control would only be as tall as the three rows in the datasource plus the header row. All controls on the page below the grid would be displayed directly below the grid.
If the datasource of the grid changed so that the results contained 15 rows, the height of the grid would change to show all 15 rows, and again, any controls on the page below the grid would show directly below the results.
Thanks.
6 Answers, 1 is accepted
0

Brandon
Top achievements
Rank 1
answered on 25 Oct 2011, 02:12 PM
Got it. I turned off scrolling and static headers and got what I needed. Thanks.
0

Ren
Top achievements
Rank 1
answered on 12 Dec 2011, 02:10 PM
I like static headers and scrolling to be turned on and I like Radgrid to auto re-size to it's container (full screen). How do I do this?
0
Hi,
The following demo exists to show how the desired functionality can be achieved:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx
Give it a try and let us know if any questions arise.
Greetings,
Pavlina
the Telerik team
The following demo exists to show how the desired functionality can be achieved:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx
Give it a try and let us know if any questions arise.
Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0

soraya
Top achievements
Rank 1
answered on 16 Dec 2011, 08:32 PM
Hi I applied the examples in the link it works good but if my grid has the property AllowMultiRowSelection="true", dont works, the headers are cut, why this is happend???? Thanks
0

Richard
Top achievements
Rank 1
answered on 16 Dec 2011, 09:39 PM
Hi Soraya,
The "aspnetajax.aspx" sample from the link below works well for me, even with AllowMultiRowSelection="true" added to the RadGrid's properties collection. I verified this using both the current 2011.3.1115 release and the 2011.2.915 builid that you reference in your project.
http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx
Can you post your code?
Cheers.
The "aspnetajax.aspx" sample from the link below works well for me, even with AllowMultiRowSelection="true" added to the RadGrid's properties collection. I verified this using both the current 2011.3.1115 release and the 2011.2.915 builid that you reference in your project.
http://www.telerik.com/community/code-library/aspnet-ajax/grid/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers.aspx
Can you post your code?
Cheers.
0

soraya
Top achievements
Rank 1
answered on 16 Dec 2011, 10:29 PM
I dont know if is ok but i resolv my problem seting this property to the grid: <HeaderStyle Height="26px" />
thanks
thanks