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

Should child controls use parent control theme?

2 Answers 112 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Emily
Top achievements
Rank 1
Emily asked on 01 Mar 2016, 02:19 PM

Hi All,

I have a RadPanel on my form, and it contains several rad buttons, a toggle switch, etc. I noticed that in order to get a theme to be applied to the child controls, I have to set it individually on each one. I was expecting that if I set the theme on the parent panel, that the child controls would all use it as well. I just wanted to make sure that I'm not doing something wrong here...am I supposed to set the theme separately on all child controls within a panel? Thank you!

2 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 01 Mar 2016, 04:44 PM
Hello Emily,

Thank you for writing.

Themes are set for each of the controls on the form individually. The static ThemeResolutionService class exposes a method for setting a theme on all child controls of a certain control: 
ThemeResolutionService.ApplyThemeToControlTree(this.radPanel1, "TelerikMetro");

The code snippet above will set the TelerikMetro theme to all of the controls within the panel. If it also suits your application you can set a default theme for your application which will be used by all controls: Using a Default Theme.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Emily
Top achievements
Rank 1
answered on 01 Mar 2016, 04:47 PM
That should do the trick. Thank you!
Tags
Themes and Visual Style Builder
Asked by
Emily
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Emily
Top achievements
Rank 1
Share this question
or