Gridview - fixing row heights

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
 
G

Gregory A. Beamer

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,
 
G

Gregory A. Beamer

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,
 
G

Guest

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...
 
G

Gregory A. Beamer

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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top