Row height of GridView

Discussion in 'ASP .Net' started by =?Utf-8?B?cmtibmFpcg==?=, Nov 2, 2007.

  1. How can I decrease the height of a gridview control?

    I modified the values in the stylesheet as given below

    ..gridview tr.even td,.detailsview tr.even td{
    background: #FFFFFF;
    height:50px;

    However, the row height is not reduced after 50PX.

    Thanks.
    --
    test
     
    =?Utf-8?B?cmtibmFpcg==?=, Nov 2, 2007
    #1
    1. Advertising

  2. you need to specify an overflow value that would allow the browser to honor
    the heigtht. try:

    .gridview tr.even td,.detailsview tr.even td{
    background: #FFFFFF;
    height:50px;
    overflow:hidden;
    }

    -- bruce (sqlwork.com)


    "rkbnair" wrote:

    > How can I decrease the height of a gridview control?
    >
    > I modified the values in the stylesheet as given below
    >
    > .gridview tr.even td,.detailsview tr.even td{
    > background: #FFFFFF;
    > height:50px;
    >
    > However, the row height is not reduced after 50PX.
    >
    > Thanks.
    > --
    > test
     
    =?Utf-8?B?YnJ1Y2UgYmFya2VyIChzcWx3b3JrLmNvbSk=?=, Nov 2, 2007
    #2
    1. Advertising

  3. No sir. It didn't help.

    Thanks.
    --
    test


    "bruce barker (sqlwork.com)" wrote:

    > you need to specify an overflow value that would allow the browser to honor
    > the heigtht. try:
    >
    > .gridview tr.even td,.detailsview tr.even td{
    > background: #FFFFFF;
    > height:50px;
    > overflow:hidden;
    > }
    >
    > -- bruce (sqlwork.com)
    >
    >
    > "rkbnair" wrote:
    >
    > > How can I decrease the height of a gridview control?
    > >
    > > I modified the values in the stylesheet as given below
    > >
    > > .gridview tr.even td,.detailsview tr.even td{
    > > background: #FFFFFF;
    > > height:50px;
    > >
    > > However, the row height is not reduced after 50PX.
    > >
    > > Thanks.
    > > --
    > > test
     
    =?Utf-8?B?cmtibmFpcg==?=, Nov 2, 2007
    #3
  4. Hi Rkbnair,

    I think the issue can also be done through the <....Style> setting in
    GridView control. If you want to specify height for all the rows in
    Gridview, you can apply setting in the <RowStyle> section e.g.

    ==========
    <asp:GridView ID="GridView1" runat="server" .................>
    <RowStyle Height="50px" />
    ................
    ===========

    If the setting is a css class, you can use the "CssClass" property. e.g.

    ==============
    <asp:GridView ID="GridView1" runat="server" ...........>
    <RowStyle CssClass="testrowstyle" />
    ............
    <Columns>
    ........
    ==============

    ====css class ======
    <head runat="server">
    <title>Untitled Page</title>
    <style id="mystyle" type="text/css" >
    .testrowstyle
    {
    height:70px;

    }
    </style>
    ............
    =======================

    Hope this helps.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead


    This posting is provided "AS IS" with no warranties, and confers no rights.

    --------------------
    >From: =?Utf-8?B?cmtibmFpcg==?= <>
    >Subject: RE: Row height of GridView
    >Date: Fri, 2 Nov 2007 12:47:00 -0700
    >
    >No sir. It didn't help.
    >
    >Thanks.
    >--
    >test
    >
    >
    >"bruce barker (sqlwork.com)" wrote:
    >
    >> you need to specify an overflow value that would allow the browser to

    honor
    >> the heigtht. try:
    >>
    >> .gridview tr.even td,.detailsview tr.even td{
    >> background: #FFFFFF;
    >> height:50px;
    >> overflow:hidden;
    >> }
    >>
    >> -- bruce (sqlwork.com)
    >>
    >>
    >> "rkbnair" wrote:
    >>
    >> > How can I decrease the height of a gridview control?
    >> >
    >> > I modified the values in the stylesheet as given below
    >> >
    >> > .gridview tr.even td,.detailsview tr.even td{
    >> > background: #FFFFFF;
    >> > height:50px;
    >> >
    >> > However, the row height is not reduced after 50PX.
    >> >
    >> > Thanks.
    >> > --
    >> > test

    >
     
    Steven Cheng[MSFT], Nov 5, 2007
    #4
    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. W@cek
    Replies:
    0
    Views:
    1,632
    W@cek
    Mar 31, 2005
  2. H5N1
    Replies:
    0
    Views:
    2,739
  3. Replies:
    5
    Views:
    678
  4. Phil Johnson

    Gridview Row Height in Opera

    Phil Johnson, Mar 18, 2008, in forum: ASP .Net
    Replies:
    2
    Views:
    1,516
    Phil Johnson
    Mar 19, 2008
  5. John

    Gridview row height

    John, May 31, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    930
    Asim SH
    Feb 3, 2011
Loading...

Share This Page