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

How do I use a theme on a RadToggleButtonElement in a RadRibbonBar?

5 Answers 252 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, 06:09 PM

I have some RadToggleButtonElements in a RadRibbonBar, and I'm trying to apply a theme to them. I already have a theme manager assigned to the ribbon bar, and it appears to be working correctly for the other control types on the ribbon bar. The RadToggleButton theme is loaded into the theme manager but it isn't being applied to the toggle buttons. I've checked the IsThemeApplied property on the buttons at runtime just to be sure, and it's always false. I found a previous post (http://www.telerik.com/forums/toggle-button-style) about how to add a RadStylesheetRelation to the RadToggleButton theme's xml file, and I tried that, but it's still not working. Is there something else I'm missing?

Note: This same RadToggleButton theme is used on another form as well, and it's working there, so I don't believe there's anything wrong with the theme itself. The only difference that I can see is that the toggle buttons on the other form are not being used in a ribbon bar.

 

Thank you!

5 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 02 Mar 2016, 10:38 AM
Hi Emily,

Thank you for writing.

In order to theme the RadToggleButtonElements in RadRibbonBar, you would need to work with the ribbon bar theme and modify the ToggleButtonInRibbon node.

The toggle buttons in the ribbon are visual elements and they have specific settings related to the ribbon which different compared to the toggle button control. I am sending you attached a screenshot from the VSB tool showing where exactly the toggle button is located in the ribbon bar hierarchy.

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 02 Mar 2016, 03:42 PM

Hi Hristo,

Thank you for the response. I guess I didn't include enough details (my mistake!). I'm actually using the toggle buttons in the quick access toolbar, and the setting you pointed to doesn't appear to affect the buttons in that part of the ribbon. Is there another way to do this? Thanks again!

Emily

0
Hristo
Telerik team
answered on 02 Mar 2016, 05:05 PM
Hi Emily,

Thank you for writing.

The toggle button elements in the quick access menu have a transparent fill. If it is convenient enough, you can perform this styling in the Visual Studio designer with Element Hierarchy Editor tool. For reference, I am also attaching a screenshot.

If you prefer to perform this change at run-time you can access the toggle button element directly and change the color of its FillPrimitive:
this.radToggleButtonElement1.ButtonFillElement.BackColor = Color.Green;

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 02 Mar 2016, 05:28 PM
Ok - I'll give that a try. I was hoping that I could use the stylesheet (ie the xml file for the RadToggleButton control) to have it automatically set the appropriate BackColor when the button is checked vs. unchecked, but it sounds like that won't work for toggle buttons in the QuickAccessToolBar. Thanks!
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Mar 2016, 02:05 PM
Hello Emily,

Thank you for writing back. 

By default, RadRibbonBar uses RadButtonElement, not RadToggleButtonElement in its quick access toolbar. In order to customize its color, you can refer to the attached screenshot from Visual Style Builder illustrating what changes are required. I have attached my sample project as well.

I hope this information helps. If you have any additional questions, please let me know.

 Regards,
Dess
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
Tags
Themes and Visual Style Builder
Asked by
Emily
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Emily
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or