4 Answers, 1 is accepted
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
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.
<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!!!!!!!!!!!
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.