Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ToolBar > UserControl styling in RadToolBar

Not answered UserControl styling in RadToolBar

Feed from this thread
  • Jon avatar

    Posted on Sep 7, 2011 (permalink)

    When I place a custom UserControl (which contains a TextBox and a RadButton) in a RadToolBar, how can I get the controls inside my UserControl to take on the re-styling that normally occurs when placing those controls directly into a toolbar?  I found this forum post:

    http://www.telerik.com/community/forums/silverlight/toolbar/text-box-or-custom-control-in-tool-bar.aspx

    which provides an great example of how to apply a custom style for a custom control in a RadToolBar, but that's not what I'm looking for. How can I get the RadToolBar to re-style the individual elements of my custom control?

    Reply

  • Tina Stancheva Tina Stancheva admin's avatar

    Posted on Sep 8, 2011 (permalink)

    Hi Jon,

    The RadToolBar controls has a predefined ItemContainerStyleSelector that sets default styles to the following types of elements:RadToolBarSeparator, TextBlock, TextBox, Button, ToggleButton, CheckBox, RadioButton, RadButton, RadToggleButton, RadRadioButton, RadDropDownButton, RadSplitButton.

    However, the ItemContainerStyleSelector can only be applied to direct children of the listed types and since in your case, the TextBox and RadButton are wrapped in another control before added to the RadToolBar you'll need to define a custom style for them. I attached a sample project that contains the predefined styles for the RadToolBar and its children. I also added a custom control with a TextBox and RadButton and I copied the RadToolBar TextBox and RadButton predefined styles and I applied it to the controls in the CustomControl. Please have a look at the solution and let me know if it helps.

    Best wishes,
    Tina Stancheva
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ToolBar > UserControl styling in RadToolBar
Related resources for "UserControl styling in RadToolBar"

Silverlight ToolBar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]