views:

282

answers:

3

Hello all.

This is a simple one but it is defeating me.

Ok, I have a gridview, lovely stuff. I have attempted to set the height of the headers so that the height is maintained regaardless of the content of the gridview.

However, if a data row requires a bit more height itself (to include the data), the height of the heading also increases.

How do I go about ensuring the height of the header is maintained but not at the expense of the data rows themselves?

A: 

You can use styles to set almost all presentation attributes. Try out using a css or add style attributes.

Kangkan
Hello Kangkan. I have applied style attributes to the header but without success - I'm not really sure why this is still. Surely if I set the header style height to x amount, this should remaining the same regardless of the data that is contained within the gridview itself?
Ricardo Deano
Are you talking about data inside the header or in the rows? Normally the gridview will be rendered as a table, with the header as a TH. In such a case, if the contenet in the said cell TD or TH grows, the cell is set to grow, unless you put the overflow style.
Kangkan
+1  A: 
lakhlaniprashant.blogspot.com
A: 

I found the reason behind my mysterious expanding rows!!

Bascially, I had set the height of my gridview. When the gridview was full with data and resulted in paging, the heading remained as it should. However, the rows expanded when this gridview was below it's quota of data - essentially .net was being clever and trying to fill the space I had created by setting the height by expanding what it could.

All I did was to remove the height of my gridview and it worked a treat.

Thanks for all the pointers though : )

Ricardo Deano