View Full Version : sizing a grid to an explicit number of rows

12 Oct 2010, 6:17 PM
I'm trying to size a grid based on the desired number of rows (page size).

Currently I have the grid set to autoHeight = true.

I limit my result set to 10 records per page. This works fine if my search results in more than 10 records.

However, when less than 10 records come back (say 2 for example) my grid only has a height for 2 rows.

I'm wondering if there is a way to explicitly size the grid to 10 records. I'm hesitant to estimate based on pixels as I think this will be harder to maintain and could lead to cross-browser rendering issues.

I'm also letting the user choose their page size and storing this in a cookie. So, I can't just set the grid height to a static value.

13 Oct 2010, 2:00 AM
After rendering the rows, you can query the height of the mainBody, add the height of the header and padding and use this to set the height of the grid.