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

Multiple Styles for a Control

9 Answers 131 Views
Themes and Visual Style Builder
This is a migrated thread and some comments may be shown as answers.
Vic
Top achievements
Rank 1
Vic asked on 13 Apr 2009, 07:27 PM
I am trying to maintain a single Theme file and would like to define multiple styles for a single control, for example a button.  If I want a purple button in one location and a red one in another, I'd like to be able to define this through a theme file rather than editing the individual elements.  i cant seem to figure out a way of accommodating this.

9 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 16 Apr 2009, 04:39 PM
Hi Vic,

Thank you for the questions.

Currently the RadControls for Winforms does not support different themes in one xml file. The only way to make different visual settings on two separate controls from the same type is to make two theme files and apply them individually to your controls.

Do not hesitate to contact me again if you have other questions.

Best wishes,
Martin Vasilev
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
Adam P
Top achievements
Rank 2
answered on 08 Feb 2014, 05:51 AM
Hi, is this still true?  I'm having a hard time understanding the purpose of the ThemeClassName property
0
Dimitar
Telerik team
answered on 11 Feb 2014, 04:50 PM
Hi Adam,

Thank you for writing.

Yes the previously provided answer is still valid. Also the ThemeClassName property is used in order the control to be bound with the proper styles in the theme. This is why we need to override this property when we creating custom controls for example.

Please let me know if there is something else I can help you with. 

Regards,
Dimitar
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Ryan
Top achievements
Rank 1
answered on 05 Jan 2015, 03:26 PM
Hi team,

Can we have multiple themes in one file or still need different theme (.xml) files?

Best Regards,
Ryan
0
Dimitar
Telerik team
answered on 08 Jan 2015, 10:51 AM
Hello Ryan,

Thank you for writing.

You cannot have multiple themes in one file. Visual Style Builder allows you to create a different styles for each control and to save the theme with a particular name. Each control in your application that uses this theme will take the predefined styles from it. In addition you can save the theme as a single file or separate xml files. 

You can have many themes in one application and you can use different theme for each control. Detailed information about the themes is available in the following articles:
I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Emily
Top achievements
Rank 1
answered on 04 Mar 2016, 04:05 PM

I thought I could use this concept to have a different theme for some of the controls on the ribbon bar, but the controls (in particular the RadButtonElement controls) don't appear to have a ThemeName property. Is it possible to use a separate theme for controls on the ribbon, apart from the theme that's assigned to the ribbon bar itself?

Thank you!

Emily

0
Dimitar
Telerik team
answered on 07 Mar 2016, 11:12 AM
Hello Emily,

Thank you for writing.

You can set the theme only for controls, not elements. As a workaround, you can use RadHostItem to add controls to the ribbon:
var button = new RadButton();
button.Text = "test";
button.ThemeName = "TelerikMetro";
var item = new RadHostItem(button);
item.MinSize = new Size(200, 22);
this.RadRibbonBarGroup1.Items.Add(item);

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
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 08 Mar 2016, 04:01 PM
This worked. Thank you!
0
Emily
Top achievements
Rank 1
answered on 08 Mar 2016, 04:01 PM
This worked. Thank you!
Tags
Themes and Visual Style Builder
Asked by
Vic
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Adam P
Top achievements
Rank 2
Dimitar
Telerik team
Ryan
Top achievements
Rank 1
Emily
Top achievements
Rank 1
Share this question
or