New an RadSkinManager, but it doesn't work

3 posts, 0 answers
  1. Big Q
    Big Q avatar
    30 posts
    Member since:
    Jan 2010

    Posted 27 Oct 2010 Link to this post

    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. Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 27 Oct 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. George Gergues
    George Gergues avatar
    1 posts
    Member since:
    Mar 2013

    Posted 02 May 2013 Link to this post

    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);
        }
Back to Top