GridView height to 100%
-
Hi guys, I have following problem: I want to display two GridViews A, B one next to the other. So I've created a simple table with one row and two columns a put griview A into the left column and the GridView B into to right column:
<table>
<tr>
<td>
A
</td>
<td>
B
</td>
</tr>
</table>I know that after items are loaded, the A will always be higher than B, so I would like to stretch B so it takes same amount of height as A. I've set the Height property on B to 100%:
<asp:GridView ID="B" runat="server" AutoGenerateColumns="False" Height="100%">
...
</asp:GridView>But the B keeps the minimum height it requires to render all rows and won't stretch to same size as A. Note that A and B are in cells of the same row, so B has available height to strech to. After some investigation I've discovered that by default, a GridView is a
<table>
encapsulated within a<div>
. And its the div that prevents the table to stretch above its minimum required height. Is there a way how to tell ASP.NET to NOT render the (empty)<div>
html tag around the table? Or change the behaviour of the<div>
to not prevent table to be stretched to any available size?zilo