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

[Solved] web.config Skin Issue

5 Answers 294 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 2
Kevin asked on 29 Apr 2008, 11:32 PM
I think we need a little better documentation regarding skins because there are many places where they can be set and the "cascade" isn't apparent.

I've set the global skin in web.config, however the RadMenu does not change based on the value.
<appSettings>
        <add key="Telerik.Skin" value="Hay"/>
</appSettings>

With this setting the control's div renders as:
<div id="ctl00_SiteMenu_RadSiteMenu" class="RadMenu RadMenu_" style="width: 800px; z-index: 7000;">

When I set the Skin in the control's properties for the control the div renders as:
<div id="ctl00_SiteMenu_RadSiteMenu" class="RadMenu RadMenu_Hay" style="width: 800px; z-index: 7000;">

There is a theme enabled in my application and when I set a theme in the .skin file the control does pick it up.  But overriding the skin at the control level does not override the .skin setting.  I got around this by setting the control's SkinID to a non-existent .skin SkinId.  I'm not sure if this is supported behavior though.

Is there something else I need to do to enable the controls to accept the global settings in web.config when a theme is set or am I stuck using the .skin file?

I'm also up for a hotfix to override the global setting on individual controls.

5 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 30 Apr 2008, 02:44 PM
Hello Kevin,

This subject is a bit confusing and we will try to improve the documentation on this subject. I will try to explain.

You can set skins per control and for all Telerik controls in the web.config file:

<appSettings>  
 <add key="Telerik.Skin" value="[SkinName]" />   <!-- Sets the skin for all Prometheus controls -->  
 <add key="Telerik.[ShortProductName].Skin value="[SkinName]" />  
   <!-- Sets the skin for a specific control -->  
</appSettings>  

These settings are the weakest. They are applied only if your control has no Skin property set at all.

Setting the skin through the ASP.NET theming mechanism always takes precedence over the global settings.

Depending on how you set the theme, the local settings can have either lower or higher priority:
  • If you set it using the "Theme" property of the page, then the local settings have lower priority.
  • If you set it using the "StyleSheetTheme" property, then the local settings have higher priority.
More information can be found in the ASP.NET Themes and Skins Overview.

I was not able to reproduce the first issue. Can you please send us a simple running project that reproduces this problem?

Kind regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kevin
Top achievements
Rank 2
answered on 30 Apr 2008, 04:42 PM
I've found the problem and I believe this to be a bug (possibly two!)

When the Skin property is cleared in the Properties dialog, the control's markup is set to  Skin="".  This prevents the control from accepting the setting in the web.config.  It does not prevent the control from accepting the setting from .skin file.  Clear out the Skin="" from the markup and the control will use the web.config setting.
0
T. Tsonev
Telerik team
answered on 07 May 2008, 08:25 AM
Hi Kevin,

Actually, what you are experiencing is the expected behavior. Setting the skin property to an empty string disables the skin for the control. This is desired behavior in some scenarios, so this value is treated as any other skin name.

The setting in the web.config is still with lower priority. The theme setting can either be with lower or higher priority, depending on whether you are using the Theme or the StyleSheetTheme property.

Greetings,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Kevin
Top achievements
Rank 2
answered on 08 May 2008, 07:03 PM
I understand the skinning priority and that's fine although it could be documented better.

But clearing a value in the properties window should not create the Skin="" in the markup as it only allows the skin set in a theme to work.  It's misleading and not expected functionality from my perspective.
0
Accepted
T. Tsonev
Telerik team
answered on 10 May 2008, 02:47 PM
Hello Kevin,

I agree that this behavior is counter-intuitive. Clearing the skin name in the property editor should clear the property. The scenario in which it has to be set to an empty string is far less common.

We will try to revise its implementation.

Kind regards,
Tsvetomir Tsonev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
Kevin
Top achievements
Rank 2
Answers by
T. Tsonev
Telerik team
Kevin
Top achievements
Rank 2
Share this question
or