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

Styling of RadAutoCompleteBoxItems

1 Answer 189 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Matthias
Top achievements
Rank 1
Matthias asked on 12 Sep 2013, 01:04 PM
I'v setup applied a custom style to a RadAutoCompleteBox in order to change its visual design. I would also like to customize its RadAutoCompleteBoxItems (e.g. change the RemoveButton). How can this be achieved?

I found a RadAutoCompleteBoxItemStyle in the built-in Themes but it seems like this style is set globally. Which property of the RadAutoCompleteBox can I use to override this default style?

Thanks for your help
Matthias

1 Answer, 1 is accepted

Sort by
0
Masha
Telerik team
answered on 17 Sep 2013, 08:00 AM
Hello Matthias,

Unfortunately there is no property of the RadAutoCompleteBox to override the RadAutoCompleteBoxStyle ate the moment. You can override it globally using implicit styles or you can set it as a separate resource to the RadAutoCompleteBox like the code snippet below:

<telerik:RadAutoCompleteBox
        DataContext="{StaticResource customersViewModel}"
        WatermarkContent="Enter a name..." 
        SelectionMode="Multiple"
        TextSearchPath="Name" 
        ItemsSource="{Binding Customers}">
<telerik:RadAutoCompleteBox.Resources>
    <Style TargetType="telerik:RadAutoCompleteBoxItem">
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Margin" Value="3 3 0 0" />
        <Setter Property="Padding" Value="2 0 " />
        <Setter Property="BorderBrush" Value="Red" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="IsTabStop" Value="False" />
        ...
    </Style>
</telerik:RadAutoCompleteBox.Resources>
</telerik:RadAutoCompleteBox>

Also you can use BoxesItemTemplate property of RadAutoCompleteBox, if you need to modify only the ControlTemplate of RadAutoCompleteBoxItemStyle.

I hope this information will be helpful.


Regards,
Masha
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
AutoCompleteBox
Asked by
Matthias
Top achievements
Rank 1
Answers by
Masha
Telerik team
Share this question
or