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

Missing background/height for NonEditableComboBox

1 Answer 45 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Tulio
Top achievements
Rank 1
Tulio asked on 09 Nov 2017, 02:48 PM

Hi,

 

We started toreplace our controls by telerik ones and noticed that the combobox wasn't getting the background of the theme we are using (Office 2016). It was keeping a gray gradient background.

 

After some investigation with the XAML forTelerik.Windows.Control.Input, the style for NonEditableComboBox consists of a grid with two borders and a RadToggleButton inside of it.

 

After some investigation, I noticed that adding the following lines to the toggle fixed my problem:

Background="{TemplateBinding Background}"
Height="{TemplateBinding Height}"

(Height had to be added for the highlight border as well)

Is this a bug? Or the expected behavior is that when using a RadComboBox the developer wont be able to get the background from the theme or be able to set the height?

Thanks!

 

 

 

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 13 Nov 2017, 11:54 AM
Hello,

This is an issue that is caused by assembly types mismatch. If you are setting a theme using the noXaml theme assemblies and implicit styles method (my merging resource dictionaries), but the control assemblies are XAML-included. Take a look at our modified setting a theme article for the difference of the two mechanisms.

There are two solutions for your current scenario:

1. Use StyleManager.ApplicationTheme = new Office2016Theme(); before the InitializeComponent(); of the MainWindow in MainWindow.xaml.cs (or in you App.xaml.cs). You can remove the theme assembly and merged dictionaries if you do not have modifications to them (as long as all the control assemblies are xaml-included (they should come from the Binaries folder)).

OR: 

2. Make sure all the assemblies are noXaml (form Binaries.noXaml folder) and merge the needed resource dictionaries in your app.xaml (without doing our controls should not be visible). You would also need to use BasedOn for any custom styles that you might be using for our controls (the default style keys are normally named by the convention <control>Style - e.g. RadButtonStyle).

As for the height - if it is smaller than the default one, you might need to reduce the MinHeight of the control as well in the case of the Office2016 theme. Otherwise, applying one of the two approaches should fix this as well.

I hope that either of these approaches would fix the issues you are experiencing.

Regards,
Martin
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ComboBox
Asked by
Tulio
Top achievements
Rank 1
Answers by
Martin
Telerik team
Share this question
or