Declined
Last Updated: 17 Aug 2015 05:56 by Cameron
Cameron
Created on: 23 Jul 2014 05:03
Category: Grid
Type: Feature Request
1
RadGrid AutoHeight functionality
For RadGrid (and other similar controls) it would be nice to be able to simply add AutoHeight="true" to the elements markup to make the grid calculate the browser height and adjust it's own height (including the scrollable DataDiv inside it) automatically rather than having to resort to custom javascript to achieve the same thing.

ie: activate AutoHeight on RadGrid and simply set the distance from the bottom of the browser window to allow for footers, etc. and have that distance maintained even when the browser is resized.

Height and ScrollHeight can only use explicit values - not percentages - which is kind of useless if you want the grid to occupy 100% of the available browser height across different devices. http://www.telerik.com/help/aspnet-ajax/grid-height-vs-scrollheight.html

4 comments
Cameron
Posted on: 17 Aug 2015 05:56
Hi Vasil

Fair enough - thanks for your reply.

Cheers,
Cameron
ADMIN
Vasil
Posted on: 17 Aug 2015 05:48
Hi Cameron,
It is always possible to implement some feature in particular case. There are several ways to achieve such behavior, and you use one of them, this hack/scripts, that are working in your page, but will not work in some other configurations.

For example what would happen if you have 2 grids on the page side by side. Or 2 grids one on top of the other? or you have 1 grid on left and 2 grids on right. And this example uses just grids, but you can add lots of different tons of markup in which you will need to tweak the JS used for calculations in order to work properly. 

It is not the first time this is requested, nor will be the last, you can find Code Library like this http://www.telerik.com/support/code-library/setting-100-height-and-resize-on-container-resize-for-grid-with-scrolling-and-static-headers dating 9 years back. And believe me, if it was possible to make feature this build-in and working for most of the configurations, we would have been implement it already. But for now each implementation have some drawbacks and does not work for particular cases.

Regards,
Vasil
Cameron
Posted on: 17 Aug 2015 00:52
Hi Vasil

Please re-read my question - you are incorrect in your assumption that it cannot happen - it is in fact possible because you guys provided a javascript hack to get RadGrid to do exactly that. 

An event handler is attached to the windows resize event which re-triggers the function that calculates the browser height and then repaints the grid accordingly.

I just want to know why this javascript hack is not incorporated into the RadGrid control itself so that this customised behaviour can simply be implemented natively from with the control at design time with a few clicks.

Regards,
Cameron
ADMIN
Vasil
Posted on: 13 Aug 2015 15:38
Can not happen, because if you make the browser window smaller, the browser will automatically include scroll and the grid will not know that the window is getting smaller or larger. It is not problem in the grid but in HTML as general.