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

Metro theme and RadComboBox Background

3 Answers 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 05 Jan 2012, 11:12 AM
Hi,

After moving from the Windows7Theme to the MetroTheme I have noticed that when setting the Background property on an editable combobox the background of the textbox part no longer changes. Is this the expected behaviour for the Metro theme?

Thanks
Andy

3 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 05 Jan 2012, 03:48 PM
Hi Andrew,

Thank you for bringing this issue to our attention. This behavior is a bug and is a result of the ScrollViewer style in Metro theme. The issue is now fixed and a fix will be available in the next LIB.

I have updated your Telerik points for your appreciated feedback.

Kind regards,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Andrew
Top achievements
Rank 1
answered on 06 Jan 2012, 11:53 AM
Hi,

Thanks for the quick response!

I have another question though I'm afraid! When changing the background I'm also changing the foreground to make the text standout. However this seems to change the foreground of the ComboBox items, but not the background.

I went back to 2011.1 dlls and this didn't seem to be a problem and the combobox items were not modified at all. I have attached some screenshots of a previous version and the current version.

Thanks,
Andy
0
Dani
Telerik team
answered on 09 Jan 2012, 10:04 AM
Hello Andrew,

To apply any change to the RadComboBoxItems you should use the ItemContainerStyle property of RadComboBox. Please, note that it will take effect if your items are loaded dynamically. If your RadComboBox has its items inline, i.e. static, you will need to set the style to each RadComboBoxItem individually.

Please, consider the following example with dynamic RadComboBoxItems:
<UserControl.Resources>
        <local:AgencyViewModel x:Key="DataSource" />
          
        <Style x:Key="RadComboBoxStyle1" TargetType="telerik:RadComboBox">              
            <Setter Property="Foreground" Value="Red"/>
            <Setter Property="Background" Value="Lime"/>            
        </Style>
  
        <Style x:Key="RadComboBoxItemStyle1" TargetType="telerik:RadComboBoxItem">
            <Setter Property="Background" Value="Yellow" />
        </Style>
    </UserControl.Resources>
  
    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadComboBox Margin="137,114,253,0" IsEditable="True" 
                             VerticalAlignment="Top" 
                             ItemsSource="{Binding Source={StaticResource DataSource}, Path=Agency}"
                             DisplayMemberPath="Name"
                             ItemContainerStyle="{StaticResource RadComboBoxItemStyle1}"
                             Style="{StaticResource RadComboBoxStyle1}" />
    </Grid>

And with static RadComboBoxItems:
<UserControl.Resources>
        <local:AgencyViewModel x:Key="DataSource" />
          
        <Style x:Key="RadComboBoxStyle1" TargetType="telerik:RadComboBox">              
            <Setter Property="Foreground" Value="Red"/>
            <Setter Property="Background" Value="Lime"/>            
        </Style>
  
        <Style x:Key="RadComboBoxItemStyle1" TargetType="telerik:RadComboBoxItem">
            <Setter Property="Background" Value="Yellow" />
        </Style>
    </UserControl.Resources>
  
    <Grid x:Name="LayoutRoot" Background="White">
        <telerik:RadComboBox Margin="137,114,253,0" IsEditable="True" 
                             VerticalAlignment="Top" 
                             Style="{StaticResource RadComboBoxStyle1}">
            <telerik:RadComboBoxItem Content="Item 1" Style="{StaticResource RadComboBoxItemStyle1}" />
            <telerik:RadComboBoxItem Content="Item 2" Style="{StaticResource RadComboBoxItemStyle1}" />
            <telerik:RadComboBoxItem Content="Item 3" Style="{StaticResource RadComboBoxItemStyle1}" />
        </telerik:RadComboBox>
    </Grid>

I hope this solve the issue.


All the best,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
General Discussions
Asked by
Andrew
Top achievements
Rank 1
Answers by
Dani
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or