RadComboboxItem foreground

5 posts, 0 answers
  1. Mike
    Mike avatar
    34 posts
    Member since:
    Jan 2010

    Posted 24 Feb 2010 Link to this post

    Hi,
    I have been struggling with the foreground property since yesterday.

    I'm trying to restyle the Combobox to be similar to the ExpressionDark toolkit.
    However, when it come to the ComboboxItem, I can't set the foreground property.

    I've tried <Setter Property="Foreground" Value="White"/> in different location within the XAML but I'm always stuck with the black foreground.

    Am I missing something (bug maybe) or I just do something wrong??
  2. Mike
    Mike avatar
    34 posts
    Member since:
    Jan 2010

    Posted 24 Feb 2010 Link to this post

    Finally found it. I had to create a Style just for the foreground property and apply it to my contentcontrol.  I dunno why i didn't figure it since yesterday.


    <Style x:Key="WhiteForeground" TargetType="ContentControl">
                <Setter Property="Foreground" Value="White"/>
    </Style>
           

            <Style x:Key="ComboBoxItem_HighlightChromeStyle" TargetType="Telerik_Windows_Controls_Chromes:ButtonChrome">
                <Setter Property="IsTabStop" Value="False"/>
                <Setter Property="Template" Value="{StaticResource ComboBoxItem_HighlightChromeTemplate}"/>
            </Style>
            <Style x:Key="RadComboBoxItemStyle1" TargetType="telerikInput:RadComboBoxItem">
                <Setter Property="MinHeight" Value="16"/>
                <Setter Property="Margin" Value="0 0 0 1"/>
                <Setter Property="Padding" Value="3 0"/>
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                <Setter Property="VerticalContentAlignment" Value="Center"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="telerikInput:RadComboBoxItem">
                            <Grid Background="Transparent">
                                <VisualStateManager.VisualStateGroups>
                                    <VisualStateGroup x:Name="CommonStates">
                                        <VisualState x:Name="Normal"/>
                                        <VisualState x:Name="MouseOver">
                                            <Storyboard>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonChrome" Storyboard.TargetProperty="RenderMouseOver">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:0">
                                                        <DiscreteObjectKeyFrame.Value>
                                                            <System:Boolean>True</System:Boolean>
                                                        </DiscreteObjectKeyFrame.Value>
                                                    </DiscreteObjectKeyFrame>
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                        <VisualState x:Name="Disabled">
                                            <Storyboard>
                                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity">
                                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.33"/>
                                                </DoubleAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
                                    </VisualStateGroup>
                                </VisualStateManager.VisualStateGroups>
                                <Telerik_Windows_Controls_Chromes:ButtonChrome x:Name="ButtonChrome" Style="{StaticResource ComboBoxItem_HighlightChromeStyle}" RenderEnabled="{TemplateBinding IsEnabled}"/>
                                <ContentControl x:Name="Content" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Style="{StaticResource WhiteForeground}"/>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
  3. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 02 Mar 2010 Link to this post

    Hello Mike,

    Thank you for contacting us.

    We are glad that you have figure it out yourself.
    Currently we are working on the proper application of the Foreground property of the ComboBoxItem, i.e. after the official release you will be able to set the Foreground property of each Item and it will work as expected.

    If you have any other questions please feel free to contact us again.

    All the best,
    Konstantina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  4. Toby Riley
    Toby Riley avatar
    40 posts
    Member since:
    Aug 2012

    Posted 19 Mar 2010 Link to this post

    Hi,

    I have upgraded from Q3 09 to Q1 10 and face a very frustrating issue with the foreground of my combobox. 
    Before it was a black background and a white foreground (In the dropdown and on selection). 
    Now after the upgrade all the items in the dropdown have a foreground of white but when I select one and the dropdown closes the selected item is show in back text (foreground).

    Can you help please?
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 24 Mar 2010 Link to this post

    Hello Tobias,

    Thank you for contacting us.

    Could you please send us a code snippet of the xaml code of your ComboBox? Also, could you explain what exactly you expect to be the behaviour of the Foreground property of the ComboBox? In that way we will be able to assist you in the best manner.

    Looking forward to your reply.

    All the best,
    Konstantina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top