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

RadComboboxitem restyle

4 Answers 147 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
b b
Top achievements
Rank 1
b b asked on 17 Aug 2009, 11:35 AM
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.

4 Answers, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 17 Aug 2009, 11:41 AM
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.
0
b b
Top achievements
Rank 1
answered on 17 Aug 2009, 12:19 PM
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?

0
Accepted
Valeri Hristov
Telerik team
answered on 18 Aug 2009, 02:37 PM
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.
0
b b
Top achievements
Rank 1
answered on 18 Aug 2009, 03:14 PM
I dont know what i did wrong the first time i tried that and failed, but that way works.Thx!
Tags
ComboBox
Asked by
b b
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
b b
Top achievements
Rank 1
Share this question
or