Gridview - fixing row heights

  • Thread starter Thread starter Iain
  • Start date Start date
I

Iain

All,

I have a GridView (with paging enabled) which I re-populate with the
following :

SqlDataSource1.SelectCommand = "SELECT ....blah blah"
SqlDataSource1.DataBind();

The above returns a variety of rows, if only 2 rows are returned the
rows are stretched height wise to fill the grid, is there anyway of
preventing this?

TIA
Iain
 
Iain said:
All,

I have a GridView (with paging enabled) which I re-populate with the
following :

SqlDataSource1.SelectCommand = "SELECT ....blah blah"
SqlDataSource1.DataBind();

The above returns a variety of rows, if only 2 rows are returned the
rows are stretched height wise to fill the grid, is there anyway of
preventing this?

Do you have height set on the control?

Peace and Grace,


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
No, the height property is blank, I take it i need to set this to a
value?

My intent here was setting a height for the entire grid can cause huge rows
when the grid only has a few rows of data. Alexy has some advice on setting
row height, which can reduce the issues, but some browsers might still mess
things up if the grid itself is bounded with a height value.

I would set up a CSS style to play with the height variables, etc, as it is
easy to change with an app you are currently debugging rather than hard
code the height in the tags (ala Alexy's suggestion).

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
My intent here was setting a height for the entire grid can cause huge rows
when the grid only has a few rows of data. Alexy has some advice on setting
row height, which can reduce the issues, but some browsers might still mess
things up if the grid itself is bounded with a height value.

I would set up a CSS style to play with the height variables, etc, as it is
easy to change with an app you are currently debugging rather than hard
code the height in the tags (ala Alexy's suggestion).

I also think that a height for the entire grid is set. It either can
be fixed by setting row height or looking into the code and checking
what style has been really applied to a grid. You either can do this
using Developer Tools extension for IE or in Firefox with some nice
plug-ins like Web developer toolbar...
 
I also think that a height for the entire grid is set. It either can
be fixed by setting row height or looking into the code and checking
what style has been really applied to a grid. You either can do this
using Developer Tools extension for IE or in Firefox with some nice
plug-ins like Web developer toolbar...

I have, personally, not been too thrilled with the Developer Tools for IE
and prefer Firebug. But, I do agree that there are plenty of tools to help
set up a site and debug it.

Peace and Grace,

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
 
Back
Top