tags:

views:

6

answers:

1

I have two panels on the same page, side by side. On contains a gridview. I want to determine the height of the gridview after databinding and set the height of the other panel correspondingly, but when I try to read the height of the gridview it comes back as 0. How do I get it's height, preferably in PX?

A: 

You can better do it in javascript. Get the offsetHeight of datagrid in javascript and set the height of other panel as below.

var height = document.getElementById("<%=GRIDID_CONTROL.ClientID%>").offSetHeight;
document.getElementById("<%=PANEL_CONTROL.ClientID%>").style.height = height;

Write this script at the end of page, so that you have markup rendered for the controls.

GS_Guy