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

RadComboBox Background not set

4 Answers 137 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
JJ Loubser
Top achievements
Rank 1
JJ Loubser asked on 25 May 2011, 02:03 PM
here is my autocomplete radcomobox:

<telerik:RadComboBox
                                                                x:Name="EditCompleteBox"
                                           Text="{Binding Model.NearestTown, Mode=TwoWay}"
                                                                Tag="{Binding Model.PostalCodeID, Mode=TwoWay}"
                                                   DisplayMemberPath="Value" 
                                                                IsEditable="False"
                                                                telerik:TextSearch.TextPath="Value"
                                                                TextSearchMode="StartsWith"
                                                                CanKeyboardNavigationSelectItems="True"
                                                                IsMouseWheelEnabled="True"
                                                                SelectionChanged="EditCompleteBox_SelectionChanged"
                                                                ItemsSource="{Binding Model.TownList, Mode=TwoWay}"
                                                                Width="250" Height="30"
                                                                Loaded="EditCompleteBox_Loaded"
                                                                StaysOpenOnEdit="True"
                                                                OpenDropDownOnFocus="True"
                                                                VirtualizingStackPanel.VirtualizationMode="Recycling"
                                                                >


                                                            <telerik:RadComboBox.ItemsPanel>
                                                                <ItemsPanelTemplate>
                                                                    <VirtualizingStackPanel/>


                                                                </ItemsPanelTemplate>
                                                            </telerik:RadComboBox.ItemsPanel>


                                                        </telerik:RadComboBox>


its works fine, but my background is not set from my styles:

<Style TargetType="telerik:RadComboBox"
>
        <Setter Property="Template" Value="{StaticResource NonEditableComboBox}" />
        <Setter Property="EditableTemplate" Value="{StaticResource EditableComboBox}" />
        <Setter Property="NonEditableTemplate" Value="{StaticResource NonEditableComboBox}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="MinHeight" Value="22" />
        <Setter Property="Padding" Value="5 0" />
        <Setter Property="Foreground" Value="{StaticResource PickerForeground_Normal}" />
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource MainColor}"/>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush" Value="{StaticResource ControlOuterBorder_Normal}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="UseLayoutRounding" Value="True" />
        <Setter Property="animation:AnimationManager.AnimationSelector">
            <Setter.Value>
                <animation:AnimationSelector>
                    <animation:AnimationGroup AnimationName="Expand">
                        <animation:SlideAnimation Direction="In" SlideMode="Top" TargetElementName="PopupRoot" />
                    </animation:AnimationGroup>
                    <animation:AnimationGroup AnimationName="Collapse">
                        <animation:SlideAnimation Direction="Out" SlideMode="Top" TargetElementName="PopupRoot" />
                    </animation:AnimationGroup>
                </animation:AnimationSelector>
            </Setter.Value>
        </Setter>


    </Style>


I did try:

 <telerik:RadComboBox
               ...
               Background="{x:Null}"
     >

or

 <telerik:RadComboBox
               ...
               Background="Orange"
     >

not working

---------------

there is a 

<ControlTemplate x:Key="EditableComboBox" TargetType="telerik:RadComboBox">

<ControlTemplate x:Key="NonEditableComboBox" TargetType="telerik:RadComboBox">

try to look in the templates where I could change the background, did not found any place to where.

Did I miss something?

4 Answers, 1 is accepted

Sort by
0
De
Top achievements
Rank 1
answered on 26 May 2011, 10:15 PM
To Telerik Reps, 
Can you provide some examples as how to skin Silverlight RadComboBox control? Thanks.
0
JJ Loubser
Top achievements
Rank 1
answered on 27 May 2011, 09:28 AM
check in the C:\Program Files\Telerik\RadControls for Silverlight Q1 2011 SP1\Themes\Summer\Themes\Summer\*.xaml for some examples...

for I just need the correct place to set the background for a RadCombox... where?
0
Pana
Telerik team
answered on 31 May 2011, 06:49 AM
Hello,

I am attaching the ComboBox.xaml file applied in a project. In the NonEditable RadComboBox template there is a ButtonChrome control that does not have its Background property TemplateBound by default. If you do bind it you can use the Background property on both editable and non editable combo.

It is a little frustrating but the Background of editable combo is white while that on a non editable is grayscale so we can not have the backgrounds in both the templates TemplateBound to the RadComboBox's Background.

Kind regards,
Pana
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
0
JJ Loubser
Top achievements
Rank 1
answered on 01 Jun 2011, 02:33 PM
thanks working
Tags
ComboBox
Asked by
JJ Loubser
Top achievements
Rank 1
Answers by
De
Top achievements
Rank 1
JJ Loubser
Top achievements
Rank 1
Pana
Telerik team
Share this question
or