RadComboboxitem restyle

5 posts, 2 answers
  1. b b
    b b avatar
    7 posts
    Member since:
    Jul 2009

    Posted 17 Aug 2009 Link to this post

    I'm trying to restyle my radcomboboxitem, but i dont find how to set the color of the Text. What property should i set exactly?
    For the moment this is my style
    <Style TargetType="telerikInput:RadComboBoxItem">  
            <Setter Property="MinHeight" Value="22" /> 
            <Setter Property="Template">  
                <Setter.Value> 
                    <ControlTemplate TargetType="telerikInput:RadComboBoxItem">  
                        <Grid x:Name="LayoutRoot" MinHeight="{TemplateBinding MinHeight}">  
                            <vsm:VisualStateManager.VisualStateGroups> 
                                <vsm:VisualStateGroup x:Name="CommonStates">  
                                    <vsm:VisualState x:Name="Normal" /> 
                                       
                                    <vsm:VisualState x:Name="MouseOver">  
                                        <Storyboard Duration="0">  
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Bd" 
                                                    Storyboard.TargetProperty="Background">  
     
                                                <DiscreteObjectKeyFrame KeyTime="0" 
                                                        Value="{StaticResource MouseOverBrush}" /> 
                                            </ObjectAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </vsm:VisualState> 
                                    <vsm:VisualState x:Name="Disabled">  
                                        <Storyboard Duration="0">  
                                            <ObjectAnimationUsingKeyFrames  
                                                    Storyboard.TargetName="DisabledVisual" 
                                                    Storyboard.TargetProperty="Visibility">  
                                                <DiscreteObjectKeyFrame KeyTime="0">  
                                                    <DiscreteObjectKeyFrame.Value> 
                                                        <Visibility>Visible</Visibility> 
                                                    </DiscreteObjectKeyFrame.Value> 
                                                </DiscreteObjectKeyFrame> 
                                            </ObjectAnimationUsingKeyFrames> 
                                        </Storyboard> 
                                    </vsm:VisualState> 
                                </vsm:VisualStateGroup> 
                            </vsm:VisualStateManager.VisualStateGroups> 
     
                            <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" 
                                    BorderThickness="{TemplateBinding BorderThickness}" 
                                    Background="#FFBBBDBE" /> 
                              
                            <ContentPresenter Margin="3,0,0,0" VerticalAlignment="Center" /> 
     
                            <Rectangle x:Name="DisabledVisual" Visibility="Collapsed" 
                                    Fill="{StaticResource DisabledBrush}" /> 
                        </Grid> 
                    </ControlTemplate> 
                </Setter.Value> 
            </Setter> 
        </Style> 

    Thx in advance.
  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 17 Aug 2009 Link to this post

    Hi b b,

    You could try with setting the Foreground property in the RadComboBoxItem style:
    <Style TargetType="telerikInput:RadComboBoxItem">   
            <Setter Property="Foreground" Value="Red" />  
    ...

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. b b
    b b avatar
    7 posts
    Member since:
    Jul 2009

    Posted 17 Aug 2009 Link to this post

    Thx for the fast response, that works indeed, must have set foreground on a wrong place when i tried it. I just have a follow up question. How to change the selected radcomboboxitem, because foreground is only applied on those in the list,not the selected one?

  4. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 18 Aug 2009 Link to this post

    Hello,

    You could try to set the Foreground property of RadComboBox, it should be inherited to the selection box item. I didn't tried it, but I suppose that this setting will propagate to the items too.

    Regards,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. b b
    b b avatar
    7 posts
    Member since:
    Jul 2009

    Posted 18 Aug 2009 Link to this post

    I dont know what i did wrong the first time i tried that and failed, but that way works.Thx!
Back to Top