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

Unable to use skin

3 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Per Granaune
Top achievements
Rank 1
Per Granaune asked on 14 Dec 2010, 02:00 PM
I'm going ever so slightly mad.

I'm using Telerik Q1 2010 (Telerik.Web.UI.dll version 2010.1.519.35) in a EpiServer solution (CSM5).

Several userControls (generic controls - not EPiServer controls) use one or more Telerik components.
I've made custom skins, which are referenced in the MasterPage file.

The first of two problems:

I'm totally uanble to make a RadGrid use a new skin. It's referenced in the MasterPage file right next to the old skin:

<link href="~/Templates/Public/Styles/Grid.Different.css" rel="stylesheet" type="text/css" runat="server"/>
<link href="~/Templates/Public/Styles/Grid.SpotPrice.css" rel="stylesheet" type="text/css" runat="server"/>

When set Skin="Different" EnableEmbeddedSkins="false", the grid is rendered completely without any formatting.
Set back to Skin="SpotPrice" EnableEmbeddedSkins="false", everything works.

Grid.Different.css has currently the exact same content as Grid.SpotPrice.css, with the exception of the internal naming:
".RadGrid_Different .rgMasterTable", etc.

Why is it completely impossible to make the radgrid find the new skin/css???
It made no difference to reference the css in the page in which the user control is referenced, compared to referencing
it in the master page.

The second problem:

Even if I settle for using the old skin - because at least I'm able to reference it - I'm unable to format everything correctly.

More precisely, the section

.RadGrid_SpotPrice .rgHeader,
.RadGrid_SpotPrice th.rgResizeCol
{
...
}

allows me to set the background and font-size of the header row of the grid. However, I can't find a way to set the font-weight.
It is completely ignored, and Firebug lists this as the top level css formatting:

.RadGrid .rgHeader, .RadGrid th.rgResizeCol {
    font-weightnormal;
    padding-bottom4px;
    padding-top5px;
    text-alignleft;
}

I'm unable to find where this css class - or indeed any "font-weight: normal" anywhere, but it's overriding every attempt I make at controlling the text of the header cells. Firebug lists the location of this css data as "http://localhost:1876/WebResource.axd?d=xK61nSE_t_j8tJQDQ5B9RsXqY0GVn0S9b4vKwY1ZuXsDXjk3WXwX8XeOyen9WIl-rEWY2bbVk4m7l4v0GOCzBU6ybV7OhG1m_uq5UNg9v2wqqGtQE5lyh_6GaRuspiuPnKAyWA2&t=634097737580000000".

What's going on here?

It should really be simple - make a new skin, reference it, and format it.

http://www.telerik.com/help/aspnet-ajax/grdcreatingnewskins.html or http://demos.telerik.com/aspnet-ajax/grid/examples/styles/headerfooterpagerstyles/defaultcs.aspx doesn't use any ".Controltype class prefix" such as ".RadGrid", but it can't have anything to do
with anything, since both of my CSS files use the same prefixes.

Any ideas? Anyone?

3 Answers, 1 is accepted

Sort by
0
Craig Mellon
Top achievements
Rank 1
answered on 14 Dec 2010, 02:27 PM
If the skin is ignoring style changes just use the important rule:

.RadGrid .rgHeader, .RadGrid th.rgResizeCol {
    font-weightnormal !important;
    padding-bottom4px;
    padding-top5px;
    text-alignleft;
}

Pretty sure I know why your custom skin isn't been detected, give me 5 minutes I'll look through a project I had this issue with.


edit
Ok one issue I had changing to a custom skin was the image paths referenced in the css, can you check these?
0
Per Granaune
Top achievements
Rank 1
answered on 14 Dec 2010, 02:46 PM
Hm. Image paths? Interesting.

Both the CSS files lie in the same place, and reference the same images, in the subfolder "Grid".
So both or neither of the CSS files should work.

Thought this was the solution - typical...
0
Per Granaune
Top achievements
Rank 1
answered on 14 Dec 2010, 03:04 PM
Good - I managed to control the font-weight by putting

font-weight: bold !important;

in

".RadGrid_SpotPrice .rgHeader,
.RadGrid_SpotPrice .rgHeader a"

while it didn't work in

".RadGrid_SpotPrice .rgHeader,
.RadGrid_SpotPrice th.rgResizeCol"
Tags
Grid
Asked by
Per Granaune
Top achievements
Rank 1
Answers by
Craig Mellon
Top achievements
Rank 1
Per Granaune
Top achievements
Rank 1
Share this question
or