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

How to register a common skin for all RadControls?

7 Answers 332 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
akohlbeck
Top achievements
Rank 1
akohlbeck asked on 27 May 2008, 03:51 PM

Hi

We are having trouble registering our custom skin for all controls in DotNetNuke.  We created a custom skin but are unsure as to where we need to put the files in our solution.  We currently have them in the root (Skin name "MySkin") and in the web.confing we have an appsetting that is: 

<add key="Telerik.Skin" value="MySkin" />

This does not work - our skin is not appearing on the control.  Are we putting the files in the correct spot, and are we registering the skin correctly for use?  If not please advise.

Thanks!

7 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 27 May 2008, 03:57 PM
Hi akohlbeck,

You would need to just add <link> tags to the Default.aspx page, referencing the css files in your custom skin folder. FYI, you can move the custom skin to the App_Themes folder and set the page Theme property to the name of that skin. This way you will get the <link> tags registered automatically by the .NET framework.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Waleed Seada
Top achievements
Rank 2
answered on 29 May 2008, 06:34 AM

Hello Akohlbeck,

You can look in the help under :

"RadControls for ASP.NET AJAX Fundamentals > Controlling Visual Appearance > Skin registration"

Global skin setting for the entire web site/web application project:

If you need to register a common skin for all RadControls in your web site/web application project or you want to assign a particular skin for each instance of RadControl, you can do that very easily modifying the web.config file as follows:
<appSettings> 
 <add key="Telerik.Skin" value="[SkinName]" />   <!-- Sets the skin for all RadControls --> 
 <add key="Telerik.[ShortProductName].Skin value="[SkinName]" /> 
   <!-- Sets the skin for a specific control --> 
</appSettings> 

Setting the value to an empty string disables the skin for the control(s).

Hope this can help
Waleed
0
John Corrigan
Top achievements
Rank 1
answered on 05 Jun 2008, 05:40 PM
If I'm understanding 'akohlbeck' correctly, I'm trying to do the same thing: register a custom skin by using the Global settings (as suggested by Waleed).

However, it looks like setting a skin Globally as described will only work for Embedded skins (which may be why Erjan repeated the instructions for manually registering the skin on a page-by-page basis using the <link> tag).

SO, the basic question remains: Is there a way to register a *custom* skin *gloablly* using the web.config?
0
Dimo
Telerik team
answered on 06 Jun 2008, 05:57 AM
Hello John,

You can register a custom skin globally by using the following two keys in web.config:

<appSettings>
    <add key="Telerik.Skin" value="MySkin" />
    <add key="Telerik.EnableEmbeddedSkins" value="false" />
</appSettings>

These keys are discussed in the following help articles:

http://www.telerik.com/help/aspnet-ajax/skinregistration.html
http://www.telerik.com/help/aspnet-ajax/disabling_embedded_resources.html


All the best,
Dimo
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
John Corrigan
Top achievements
Rank 1
answered on 06 Jun 2008, 02:40 PM
Dimo,

Thanks for the quick response. The code sample and the links helped me track down more of the information I needed.

Setting the theme globally (for all rad controls or specific rad controls) using the web.config was pretty straightforward. Adding the key to turn enableembeddedskins to 'false' (again, for either all rad controls or a specific control) was key to assigning a custom skin.

However,  it is still necessary to add the <link> to load the appropriate CSS files for the page. Just thought I would point this out to anyone following this thread.

Another note to anyone planning on setting up global custom skin: some controls may require more manual settings changes at the control level, since the css files may not be set up to control every image or setting. For example, if you set a custom skin for the Calendar (DatePicker) control, you must manually set the path information for the <DatePopupButton> images, the Navigation images of the <Calendar>, etc.
0
Waleed Seada
Top achievements
Rank 2
answered on 08 Jun 2008, 10:44 AM
Hello John ,

I am using a custom control to apply dynamic themes to my web application, I don't have this problem with .Css cause I put for each theme under each folder the .css file, which is loaded automatically.

If you are interested I can share this approach with you.

Best regards,
Waleed
0
Dimo
Telerik team
answered on 09 Jun 2008, 05:43 AM
Hello John,

You are right - CSS files for custom skins must be registered manually, unless you are using ASP.NET themes, as Waleed pointed out. The opportunity to register custom skins manually exists so that developers who want to optimize their CSS, can combine all skins into a single stylesheet.

With regard to the images, RadGrid and RadCalendar offer the ImagesPath property, which specifies a single location of all images the respective control needs, so that you don't have to declare a path for each image separately. The only thing to keep in mind is that in this case the control will search for images with specific names, listed here:

RadGrid Skins

RadCalendar - Creating Custom Skins


Sincerely yours,
Dimo
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
akohlbeck
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Waleed Seada
Top achievements
Rank 2
John Corrigan
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or