This is a migrated thread and some comments may be shown as answers.

Grid Row height problem

4 Answers 178 Views
Grid
This is a migrated thread and some comments may be shown as answers.
sudheer
Top achievements
Rank 2
sudheer asked on 04 Feb 2009, 06:02 AM
Hi ,

Is there any property for maintaining grid row height .  because row height is varying from one grid to another grid

Thanks for any help

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Feb 2009, 08:17 AM
Hi,

Normally setting row height using ItemStyle-Height will be affecting only the corresponding Grid. Since you are trying to set same row height of more than one  Grid I would suggest you to override the skin settings using css on the top of the page. So that all Grid comming in that page with same skin will be having the Same row width.

Style.Css:
<head runat="server"
    <title>Untitled Page</title> 
    <style type="text/css" > 
     .GridRow_Default td, 
     .GridAltRow_Default td, 
      { 
         
         height:30px !important; 
      }  
    </style> 
  
</head> 


Thanks
Shinu
0
Dimo
Telerik team
answered on 04 Feb 2009, 08:23 AM
Hello,

Please note that table cell height is treated more like a min-height - if the content is more than the set height, the table cell will expand.

Other ways to control the table cells' height is to reduce (or increase) the top and bottom cell padding.

By the way, the second comma in the above CSS selector should be removed. This is correct:


.GridRow_Default td,
.GridAltRow_Default td
{
    height:30px !important;
}


Greetings,
Dimo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steven Archibald
Top achievements
Rank 1
answered on 07 Mar 2009, 12:07 AM
I've tried this in a similar fashion to set the margins and padding of the rows. My code below is inline in my page:

 

<style type="text/css">

 

 

.GridRow_Default td, .GridAltRow_Default td

 

{

 

background-color: Lime;

 

 

margin-top: 0px;

 

 

margin-bottom: 0px;

 

 

padding-top: 0px;

 

 

padding-bottom: 0px;

 

}

 

</style>

It doesn't work. I get the Lime background, but the padding are being overridden. By using the IE developer tools, I can see what styles are being applied to each cell. GridRow_Default TD is listed several times. The padding bottom and top are scratched out, and the very last one (which I assume following CSS cascading rules is being applied shows that they both have a value of 0.4em.

I've even written code in the code-behind on the PreRender event to apply the style attributes "padding-bottom: 0px" and "padding-bottom: 0px" and that is not working.

My rules should be applied last. I've had this fraking problem before with other controls. MY STYLES TAKE PRECEDENCE! IF I SCREW IT UP THAT'S MY PROBLEM - BUT YOU SHOULD NOT OVERRIDE WHAT I WANT!!!!!!!!!!!

 

0
Dimo
Telerik team
answered on 08 Mar 2009, 08:44 AM
Hello Steven,

No frustration is necessary in this case. In order to make your styles take precedence, you need to supply CSS rules with higher specificity - this is the way CSS works. Here is some more related information:

How to override styles in embedded skins

By the way, TD's don't have margins.

All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
sudheer
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Dimo
Telerik team
Steven Archibald
Top achievements
Rank 1
Share this question
or