I have a grid whose height is set on server side while it loads. The grid also have filtering which will show few rows (less than 5) when filter applied.
The problem is when the filter is applied and the grid height is unchanged, the rows span over the available height of the grid with more space between the rows. I want to avoid this space and have all the rows together. If any one knows a solution, please help.
Do you have a DefaultRowHeight set? Also, how are you setting the height on the grid? Be sure that you set the grid.Height and the grid.DisplayLayout.FrameStyle.Height to the same value.
-Tony
Hi Tony,
I dont have the DefaultRowHeight set any where, I use wrap on cells so the height of the row depends on the contents of the row.
I use the following code to set the height of the grid in the code behind (c#) initially
{
}
else
Then I use the javascript to set the height of the grid to the available height of the browser on onresize event of the window
var grid = igtbl_getGridById(gridName);
gridHeight= clientHigh-125;
grid.resize(grid.MainGrid.offsetParent.offsetWidth - 4, gridHeight)
I get scrolling within the grid and page doesnt have scrolling and it looks good when I have many rows.
Then if I apply filter on the column to show only 3 rows, these 3 rows will occupy the whole height of the grid with 1/3 of height for each row.
I want the height of the grid to automatically change acording to the content of the rows and if the content exceeds the page available height then have a scroll bar within the grid.
Any help will be much appreciated.
Thanks in advance.