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

New an RadSkinManager, but it doesn't work

2 Answers 244 Views
SkinManager
This is a migrated thread and some comments may be shown as answers.
Big Q
Top achievements
Rank 1
Big Q asked on 27 Oct 2010, 08:35 AM

Hello,
I want to add a RadSkinManager by coding, so below is my codes:

protected void Page_Load(object sender, EventArgs e)
{
    RadSkinManager skinManager = new RadSkinManager();
    skinManager.Skin = "Forest";
}

But nothing was happened, it doesn't work. When I write code like this:

protected void Page_Load(object sender, EventArgs e)
{
    RadSkinManager skinManager = new RadSkinManager();
    //skinManager.Skin = "Forest";
    skinManager.ApplySkin(RadPane1,"Forest");
}

 It works well. But I want to change skin for all the RadControls in the page, not one of them.If it can works,I could write these code in
BasePage, and let all the pages inherit it , so that I don't need to add RadSkinManager for each page.

2 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 27 Oct 2010, 10:02 AM
Hello,

When using RadSkinManager, you should remove the Skin property of all other RadControls on the page. Also, do you actually add the RadSkinManager to the page? I don't see this in your code.

All the best,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
George Gergues
Top achievements
Rank 1
answered on 02 May 2013, 08:56 PM
The code below will apply a skin for all the controls on the page (or webpart in my case)
my Skin Manager is named SkinManager

using reflection , you can run through the controls and inspect the types as follows.

Best of luck


SkinManager.Skin = themeSkin;
foreach (Control c in this.Controls)
{
    if (c.GetType().FullName.ToLower().Contains("telerik") &&
        !c.GetType().FullName.ToLower().Contains("skinmanager"))
    {
        SkinManager.TargetControls.Add(c.ID, themeSkin);
        SkinManager.ApplySkin(c, themeSkin);
    }
Tags
SkinManager
Asked by
Big Q
Top achievements
Rank 1
Answers by
Dimo
Telerik team
George Gergues
Top achievements
Rank 1
Share this question
or