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

[Solved] RadSkinManager programmically

2 Answers 118 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Zach
Top achievements
Rank 1
Zach asked on 08 May 2009, 06:40 PM
Hello, I am trying to add a RadSkinManager to my page programmically (using a BasePage that is inherited by all my web forms - master page isn't necessary or preferred for this project). For whatever reason, it is getting ignored. Below is my code (ScriptManager and RadFormDecorator work perfectly): Thanks for any help!

                //add a script manager to page form
                ScriptManager smMain = new ScriptManager();
                smMain.ID = "smMain";
                Page.Form.Controls.AddAt(0, smMain);

                //add a RadSkinManager to page form (used for RadControls themeing)
                RadSkinManager skmSkin = new RadSkinManager();
                skmSkin.ID = "skmSkin";
                skmSkin.Skin = "Forest"; //actual value read from web.config
                Page.Form.Controls.AddAt(1, skmSkin);

                //add a RADFormDecorator to page form (used for non-RadControls controls theming)
                RadFormDecorator tfdMain = new RadFormDecorator();
                tfdMain.ID = "rfdMain";
                tfdMain.Skin = "Forest"; //actual value read from web.config
                tfdMain.ControlsToSkip = FormDecoratorDecoratedControls.None;
                tfdMain.DecoratedControls = FormDecoratorDecoratedControls.All;
                Page.Form.Controls.AddAt(2, tfdMain);

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel
Telerik team
answered on 11 May 2009, 08:43 AM
Hello Zach,

When are you adding the SkinManager to the form? In order this to work you should add it on the Page_Init handler. Try it out and let me know if this helps.

Greetings,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Zach
Top achievements
Rank 1
answered on 12 May 2009, 02:46 PM
Thanks, that worked. I was using the PreLoad handler since using the OnPreInit handler caused it to error out. I never thought of using OnInit, which happens a little later.

Thanks,
Zach
Tags
General Discussions
Asked by
Zach
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Zach
Top achievements
Rank 1
Share this question
or