Row height of GridView

G

Guest

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

Guest

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

Guest

No sir. It didn't help.

Thanks.
--
test


bruce barker (sqlwork.com) said:
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)
 
S

Steven Cheng[MSFT]

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.

--------------------
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top