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

ComboBox styles and templates

3 Answers 1310 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sergiy
Top achievements
Rank 1
Sergiy asked on 14 Nov 2012, 09:13 AM
Hello, I want to change Combobox style ( for instance simple changes of borderbrush, see attached file please).
I tried to change some value of colors in templates, but there is no any result.

Could you explain me step-by-step how can I change borderbrush (of cause separate color when control is enabled and disabled)?
Thank You

3 Answers, 1 is accepted

Sort by
0
Accepted
Masha
Telerik team
answered on 19 Nov 2012, 11:53 AM
Hello Sergiy,

To change the BorderBrush and MouseOver color of RadComboBox, you need to modify the style applied on RadToggleButton(x:Name=PART_DropDownButton). Inside it you can define the BorderBrush you wish to apply on your RadComboBox. In the attached project it is
<Style x:Key="CustomNonEditableComboToggleButtonStyle" TargetType="telerik:RadToggleButton" BasedOn="{StaticResource NonEditableComboToggleButtonStyle}">
    <Setter Property="BorderBrush" Value="{StaticResource AccentBrush}" />
    <Setter Property="Template" Value="{StaticResource CustomNonEditableComboToggleButtonControlTemplate}" />
</Style>

CustomNonEditableComboToggleButtonControlTemplate is responsible for rendering mouse over brushes, pressed and selection brushes. Inside it search for
<Border x:Name="ToggleButtonBackgroundChecked" Grid.ColumnSpan="2" Background="{StaticResource AccentBrush}" Visibility="Collapsed" />

and modify the background color with the color of your choice. 

If you wish to make modification on BorderBrush in Focus state you should modify the Border with name x:Name="FocusVisual" as well.

Please, find attached an illustrative sample, using Implicit Styles.
Hope it helps.

All the best,
Maria
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
miki
Top achievements
Rank 1
answered on 30 Dec 2014, 02:03 PM
i found this thread because i search for something like this.
So i tool the example solution and add another ComboBox but the new one is with the default style, how can i change this style like the first one ?
0
Nasko
Telerik team
answered on 05 Jan 2015, 03:14 PM
Hello Sergui,

The provided sample project uses Implicit Styles in order to modify the style of RadComboBox - thus the style should be applied implicitly to all RadComboBoxes inside the project, so everything should work as expected. Please, check the following article from our help documentation that provides more detailed information about the Implicit Styles:
http://docs.telerik.com/devtools/wpf/styling-and-appearance/styling-apperance-implicit-styles-overview.html

Hopes this helps.

Regards,
Nasko
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.

 
Tags
ComboBox
Asked by
Sergiy
Top achievements
Rank 1
Answers by
Masha
Telerik team
miki
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or