Articles in this section
Category / Section

How to Customize the DropDownBackground and DropDownTextColor in .NET MAUI Autocomplete?

The .NET MAUI Autocomplete control allows you to customize the dropdown background and text color using theme keys. Specifically, you can use the SfAutocompleteDropdownBackground and SfAutocompleteDropdownTextColor theme keys in the Resource Dictionary. Here’s how you can achieve this:

XAML

<ContentPage xmlns:editors="clr-namespace:Syncfusion.Maui.Inputs;assembly=Syncfusion.Maui.Inputs"
             xmlns:themes="clr-namespace:Syncfusion.Maui.Core.Themes;assembly=Syncfusion.Maui.Inputs">
    <ContentPage.BindingContext>
        <local:EmployeeViewModel x:Name="viewModel" />
    </ContentPage.BindingContext>
    <ContentPage.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <themes:SfAutocompleteStyles></themes:SfAutocompleteStyles>
                <ResourceDictionary>
                    <x:String x:Key="SfAutoCompleteTheme">CommonTheme</x:String>
                    <Color x:Key="SfAutocompleteDropdownBackground">YellowGreen</Color>
                    <Color x:Key="SfAutocompleteDropdownTextColor">Red</Color>
                </ResourceDictionary>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </ContentPage.Resources>
    <StackLayout Spacing="10" VerticalOptions="Center">
        <editors:SfAutocomplete Placeholder="Enter an employee"
                                TextMemberPath="Name"
                                DisplayMemberPath="Name"
                                ItemsSource="{Binding Employees}"
                                WidthRequest="300"
                                HeightRequest="40"
                                x:Name="autoComplete">
        </editors:SfAutocomplete>
    </StackLayout>
</ContentPage>

Output

YppksVQ9i6.png

Conclusion
I hope you enjoyed learning how to customize the DropDownBackground and DropDownTextColor in .NET MAUI Autocomplete (SfAutocomplete).

Refer to our .NET MAUI Autocomplete feature tour page to learn about its other groundbreaking features. You can explore our .NET MAUI Autocomplete documentation to understand how to present and manipulate data.

For current customers, check out our .NET MAUI components from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to explore our .NET MAUI Autocomplete (SfAutocomplete) and other .NET MAUI components.

Please let us know in the comments section below if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied