Gridview - fixing row heights

Discussion in 'ASP .Net' started by Iain, Oct 1, 2009.

  1. Iain

    Iain Guest

    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, Oct 1, 2009
    #1
    1. Advertising

  2. Iain <> wrote in news::

    > 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! |
    *******************************************
    Gregory A. Beamer, Oct 1, 2009
    #2
    1. Advertising

  3. Iain

    Iain Guest

    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?
    Iain, Oct 1, 2009
    #3
  4. On Oct 1, 4:50 pm, Iain <> 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" />
    Alexey Smirnov, Oct 1, 2009
    #4
  5. Iain <> wrote in
    news:#:

    > 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! |
    *******************************************
    Gregory A. Beamer, Oct 1, 2009
    #5
  6. On Oct 1, 8:02 pm, "Gregory A. Beamer"
    <> wrote:
    > Iain <> wrote innews:#:
    >
    > > 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...
    Alexey Smirnov, Oct 2, 2009
    #6
  7. Alexey Smirnov <> wrote in
    news::

    > 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! |
    *******************************************
    Gregory A. Beamer, Oct 2, 2009
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad

    TextBox heights

    tshad, Jun 24, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    521
    =?Utf-8?B?V2FyYW4=?=
    Jun 24, 2005
  2. Sandip Chitale
    Replies:
    0
    Views:
    688
    Sandip Chitale
    Aug 7, 2003
  3. H5N1
    Replies:
    0
    Views:
    2,700
  4. Replies:
    5
    Views:
    649
  5. table row heights

    , Jan 4, 2007, in forum: HTML
    Replies:
    17
    Views:
    1,455
    dorayme
    Jan 5, 2007
Loading...

Share This Page