views:

28

answers:

3

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
A: 

Based on height, I am not sure if this possible during binding.

Instead I will do by counting number of rows.

Saar
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
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
A: 

By default, the GridView will render as high as it needs to be. Is your problem with a surrounding container?

citronas