Styling of RadAutoCompleteBoxItems

2 posts, 0 answers
  1. Matthias
    Matthias avatar
    1 posts
    Member since:
    Dec 2012

    Posted 12 Sep 2013 Link to this post

    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
  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 17 Sep 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top