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
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
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
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
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