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

Styling

1 Answer 8 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
gisela
Top achievements
Rank 1
gisela asked on 13 Dec 2015, 09:41 PM

Hi Telerik Team,

i want change the selection color of the AutoCompletebox.

If i set

<SolidColorBrush x:Key="TextSelectionHighlightColorThemeBrush" Color="#FFCCCCCC"/>

the selected string of the Windows Default TextBox has this color.

What i have to do for the AutocompleteBox?

 

Still another question:

I habe found an example to change the "TelerikAutoCompleteBoxSelectorSelectedItemBackgroundBrush".  The example works fine, but when i use the same xaml-file in my Project, and set in the App.xaml file:

"<telerik:UserThemeResources x:Key="ThemeResource" DarkResourcesPath="ms-appx:///Themes/Dark.xaml" LightResourcesPath="ms-appx:///Themes/Light.xaml"/>",

the TelerikAutoCompleteBoxSelectorSelectedItemBackgroundBrush does not change.

Any Idea?

 

Thanks in advance

Gisela

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 16 Dec 2015, 07:28 AM
Hi Gisela,

I tried following the steps described in this article and the code works as expected. I successfully changed the "TelerikAutoCompleteBoxSelectorSelectedItemBackgroundBrush" brush with my own. All I had to do is to create the following ResourceDictionary in my App.xaml file:

<Application x:Class="WU_Autocomplete.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="using:Telerik.UI.Xaml.Controls"
             xmlns:local="using:WU_Autocomplete">
    <Application.Resources>
        <ResourceDictionary>
            <telerik:UserThemeResources x:Key="MyResources"
                                        DarkResourcesPath="ms-appx:///Assets/MyResourcesDark.xaml" />
        </ResourceDictionary>
    </Application.Resources>
</Application>
Next step is to create the "MyResourcesDark" resource dictionary holding all named brushes.

<ResourceDictionary
    xmlns:local="using:WU_Autocomplete.Assets">
    <SolidColorBrush Color="Green"
                     x:Key="TelerikAutoCompleteBoxSelectorSelectedItemBackgroundBrush" />
</ResourceDictionary>
Please bare in mind that I defined it in the Assets folder of each project and set its BuildAction to Page. The last step of this approach is to force the RadAutocompleteBox to use the DarkTheme.This can be done from code like this:

this.radAutoCompleteBox.RequestedTheme = ElementTheme.Dark;
Please try out this approach and let us know if you need any further assistance.

Regards,
Pavel R. Pavlov
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
AutoCompleteBox
Asked by
gisela
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or