Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Gridview - fixing row heights

Reply
Thread Tools

Gridview - fixing row heights

 
 
Iain
Guest
Posts: n/a
 
      10-01-2009
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
 
Reply With Quote
 
 
 
 
Gregory A. Beamer
Guest
Posts: n/a
 
      10-01-2009
Iain <(E-Mail Removed)> wrote in news:(E-Mail Removed):

> 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! |
*******************************************
 
Reply With Quote
 
 
 
 
Iain
Guest
Posts: n/a
 
      10-01-2009
Gregory A. Beamer wrote:

> Do you have height set on the control?
>
> Peace and Grace,



No, the height property is blank, I take it i need to set this to a value?
 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      10-01-2009
On Oct 1, 4:50*pm, Iain <(E-Mail Removed)> wrote:
> Gregory A. Beamer wrote:
> > Do you have height set on the control?

>
> > Peace and Grace,

>
> No, the height property is blank, I take it i need to set this to a value?


Yes, set height property for each row using

<RowStyle Height="50px" />
 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      10-01-2009
Iain <(E-Mail Removed)> wrote in
news:#(E-Mail Removed):

> Gregory A. Beamer wrote:
>
>> Do you have height set on the control?
>>
>> Peace and Grace,

>
>
> 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! |
*******************************************
 
Reply With Quote
 
Alexey Smirnov
Guest
Posts: n/a
 
      10-02-2009
On Oct 1, 8:02*pm, "Gregory A. Beamer"
<(E-Mail Removed)> wrote:
> Iain <(E-Mail Removed)> wrote innews:#(E-Mail Removed):
>
> > Gregory A. Beamer wrote:

>
> >> Do you have height set on the control?

>
> >> Peace and Grace,

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


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...
 
Reply With Quote
 
Gregory A. Beamer
Guest
Posts: n/a
 
      10-02-2009
Alexey Smirnov <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> 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! |
*******************************************
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
table row heights admin@daytonalink.com HTML 17 01-05-2007 11:49 PM
Gridview row databound event - can't get past the 1st row of gridview maurban@gmail.com ASP .Net 5 10-13-2006 09:37 PM
GridView nested in DataList - refreshing corresponding DataList row after updating GridView row H5N1 ASP .Net 0 04-26-2006 11:41 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
Highlight the row and click anywhere to select a row in a GridView Fernando Lopes ASP .Net 0 04-28-2005 12:24 PM



Advertisments