I need to manually page a GridView based report, i.e. add a second page and GridView, when the height of my first GridView exceeds a limit. Is there a way I can determine the height of the GridView while data binding?
A:
You can use Javascript to get the value of Height being rendered in the Page like
<script language="javascript" type="text/javascript">
function getValue()
{
var _gridheight= document.getElementById("GridView1").clientHeight;
alert(_gridheight);
}
</script>
HotTester
2010-03-09 10:01:28
A:
Based on height, I am not sure if this possible during binding.
Instead I will do by counting number of rows.
Saar
2010-03-09 10:16:31
I'm doing that now, but since the rows have variable heights, I will have to make all rows twice as high as the averagen row height to cater for the maximum height.
ProfK
2010-03-09 10:23:58
I have gone few times through such requests. Probable solutions would be have all rows with same height. Show extra data in tooltip (which cause increase in height). Of course customer should agree to it. There should some more ways.
Saar
2010-03-09 10:46:14
A:
By default, the GridView will render as high as it needs to be. Is your problem with a surrounding container?
citronas
2010-03-09 11:36:04