6 Incredible Features of WPF AutoComplete Text Box
Tags: wpf, csharp, dotnet, productivity
Published: 2021-03-10 11:41:15

---
title: 6 Incredible Features of WPF AutoComplete Text Box
published: true
date: 2021-03-10 10:59:21 UTC
tags: wpf, csharp, dotnet, productivity
canonical_url: https://www.syncfusion.com/blogs/post/6-features-of-wpf-autocomplete-text-box.aspx
cover_image: https://www.syncfusion.com/blogs/wp-content/uploads/2021/03/6-Incredible-Features-of-WPF-AutoComplete-TextBox-672x372.png
---

Our Syncfusion [WPF AutoComplete text box](https://www.syncfusion.com/wpf-ui-controls/autocomplete "Link to the WPF AutoComplete") control is a complete [MVVM](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel "Link to the Wikipedia article MVVM")-structured (model-view-viewmodel) control. It provides autocomplete functionality with features like data binding, different search modes, drop-down customization, and themes. This control is the best choice if you need autocomplete functionality in the WPF [ComboBox](https://www.syncfusion.com/wpf-ui-controls/combobox "Link to the WPF ComboBox"). It can also be used as a multiselect combo box by enabling the multiselect mode in it.

**Note:** Basically, you can achieve the autocomplete features by adding our WPF AutoComplete control to your application.

In this blog post, I will give you a quick walk-through of our Syncfusion WPF AutoComplete text box control and its top six features:

- [Different filtering modes](#different-filtering-modes)
- [Multiple-selection support](#multiple-selection)
- [Text highlighting support](#text-highlighting)
- [Custom search](#custom-search)
- [Diacritic sense](#diacritic-sense)
- [Customizing AutoComplete control as a ComboBox](#customizing-wpf-autocomplete-control-as-a-combobox)

![WPF AutoComplete text box](https://www.syncfusion.com/blogs/wp-content/uploads/2021/02/WPF-AutoComplete-text-box.png)<figcaption>WPF AutoComplete text box</figcaption>

## Different filtering modes

The WPF AutoComplete control comes with a predefined set of filtering modes that filter suggestions based on the characters typed in the text box. The preferred mode is [StartsWith](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Input.SuggestionMode.html "Link to Enum SuggestionMode API reference"), which filters the suggestions when the beginning of the string has matches in the list.

The [Contains](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Input.SuggestionMode.html "Link to Enum SuggestionMode API reference") mode lists all the suggestion words that contain the character typed in the text box, similar to the Google search engine.

Refer to the following code example.

```html
<syncfusion:SfTextBoxExt AutoCompleteSource="{Binding Countries}"
                         AutoCompleteMode="Suggest"
                         SuggestionMode="Contains"/>
```

Refer to the following screenshot.

![Contains filtering option in WPF AutoComplete](https://www.syncfusion.com/blogs/wp-content/uploads/2021/02/Contains-filtering-option-in-WPF-AutoComplete.png)<figcaption>Contains filtering option in WPF AutoComplete</figcaption>

## Multiple selection

This feature allows you to select multiple items, similar to the email search bar available in the Outlook application. Users can select multiple items either by  [token representation](https://help.syncfusion.com/wpf/autocomplete/single-and-multiple-selection#multiple-selection-using-tokens "Link to multiple selection using tokens feature in WPF AutoComplete documentation") or by simply dividing them with a [delimiter](https://help.syncfusion.com/wpf/autocomplete/single-and-multiple-selection#multiple-selection-using-delimiter "Link to multiple selection using delimiter feature in WPF AutoComplete documentation"). To do so, we have to set the [MultiSelectMode](https://help.syncfusion.com/wpf/autocomplete/single-and-multiple-selection#multi-selection "Link to single and multiple selection feature in WPF AutoComplete") property to Token or Delimiter.

Customizable token representation allows users to remove an item with a close button. With this, users can divide the selected items with characters they choose, such as dollar representation ($), or by using the traditional comma.

Refer to the following code example.

```html
<Syncfusion:SfTextBoxExt AutoCompleteSource="{Binding Countries}"
                         AutoCompleteMode="Suggest"
                         MultiSelectMode="Token"/>
```

Refer to the following GIF image.

![Multiselection mode in WPF AutoComplete](https://www.syncfusion.com/blogs/wp-content/uploads/2021/02/Multiselection-mode-in-WPF-AutoComplete.gif)<figcaption>Multiselection mode in WPF AutoComplete</figcaption>

## Text highlighting

This feature highlights the matching text in each suggested item. This helps users detect how the items are filtered (in which filtering mode) and pick items with more clarity. It also makes the search easy with this UI.

Using [TextHighlightMode](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Input.SfTextBoxExt.html#Syncfusion_Windows_Controls_Input_SfTextBoxExt_TextHighlightMode "Link to TextHighlightMode API reference"), users can choose whether to highlight a single instance or multiple occurrences of the character typed.

Refer to the following code example.

```html
<Syncfusion:SfTextBoxExt AutoCompleteSource="{Binding Countries}"
                         AutoCompleteMode="Suggest"
                         SuggestionMode="Contains"
                         TextHighlightMode="MultipleOccurrence"
                         HighlightedTextColor="Red"/>
```

Refer to the following screenshot.

![Text highlighted in WPF AutoComplete suggestions list](https://www.syncfusion.com/blogs/wp-content/uploads/2021/02/Text-highlighted-in-WPF-AutoComplete-suggestions-list.png)<figcaption>Text highlighted in WPF AutoComplete suggestions list</figcaption>

## Custom search

This feature allows users to perform a multipath search, or a custom search based on search criteria other than the predefined filtering modes. This can be done by setting the [SuggetionMode](https://help.syncfusion.com/wpf/autocomplete/autocomplete-and-filtering#filtering-options "Link to filtering options in WPF Autocomplete documentation") property to [Custom](https://help.syncfusion.com/wpf/autocomplete/multipath-search "Link to the multipath search feature in WPF AutoComplete documentation"). Users can also define a custom filter and assign it to the [Filter](https://help.syncfusion.com/cr/wpf/Syncfusion.Windows.Controls.Input.SfTextBoxExt.html#Syncfusion_Windows_Controls_Input_SfTextBoxExt_Filter "Link to the filter property in WPF API reference") property.

Refer to the following code example.

```csharp
{
     this.textboxext.SuggestionMode = SuggestionMode.Custom;
     this.textboxext.Filter = Filtering;
}

public bool Filtering(string search, object item)
    {
        var model = item as Model;
        if (model != null)
        {
            if ((model.Name.ToLower().Contains(search.ToLower())) || ((model.ID).ToString().ToLower().Contains(search.ToLower())))
            {
                return true;
            }
        }
        return false;
    }
```
Refer to the following screenshot.

![Multipath search in WPF AutoComplete](https://www.syncfusion.com/blogs/wp-content/uploads/2021/02/Multipath-search-in-WPF-AutoComplete.png)<figcaption>Multipath search in WPF AutoComplete</figcaption>

## Diacritic sense

The AutoComplete control comes with a special feature for supporting languages with letters containing diacritic marks and searching for them with English characters from the keyboard. This feature helps populate items for your search by either considering or ignoring the [diacritic](https://help.syncfusion.com/wpf/autocomplete/diacritic-sensitivity "Link to the diacritic sensitivity feature in WPF AutoComplete documentation").

Refer to the following code example.

```html
<Syncfusion:SfTextBoxExt AutoCompleteSource="{Binding DiacriticCollection}"
                         AutoCompleteMode="Suggest"
                         IgnoreDiacritic="False"
                         SuggestionMode="Contains"/>
```

Refer to the following screenshot.

![Diacritic sensitivity in AutoComplete](https://www.syncfusion.com/blogs/wp-content/uploads/2021/02/Diacritic-sensitivity-in-AutoComplete.png)<figcaption>Diacritic sensitivity in AutoComplete</figcaption>

## Customizing WPF AutoComplete control as a ComboBox

The WPF AutoComplete control can also be used as a ComboBox with autocomplete functionality by enabling the drop-down button. This can be done by setting the [ShowDropDown](https://help.syncfusion.com/wpf/autocomplete/textbox-customization#setting-the-dropdown-icon "Link to the TextBox customization feature in WPF AutoComplete documentation")  property to true.

Refer to the following code example.

```html
<Syncfusion:SfTextBoxExt AutoCompleteSource="{Binding Countries}"
                         AutoCompleteMode="Suggest"
                         ShowDropDown="True"/>
```

Refer to the following screenshot.

![AutoComplete text box as ComboBox](https://www.syncfusion.com/blogs/wp-content/uploads/2021/02/AutoComplete-text-box-as-ComboBox.png)<figcaption>AutoComplete text box as ComboBox</figcaption>

## Conclusion

Thanks for reading! In this blog, we have covered the top six features of our Syncfusion [WPF Autocomplete](https://www.syncfusion.com/wpf-ui-controls/autocomplete "Link to the WPF AUtoComplete") control to improve your application. Refer to our UG [documentation](https://help.syncfusion.com/wpf/autocomplete/overview "Link to the WPF AUtoComplete documentation") to learn about all the available features. You can also try our [WPF AutoComplete demos](https://github.com/syncfusion/wpf-demos/tree/master/dropdown/AutoComplete "Link to the WPF AutoComplete demos on GitHub").

If you aren’t a customer yet, you can try our 30-day [free trial](https://www.syncfusion.com/downloads "Link to the free evaluation of the Syncfusion Essential Studio") to check out these features.

If you wish to send us feedback or would like to submit any questions, please feel free to post them in the comments section of this blog post. You can also contact us through our [support forum](https://www.syncfusion.com/forums "Link to the Syncfusion support forum"), [feedback portal](https://www.syncfusion.com/feedback "Link to Syncfusion Feedback Portal"), or [Direct-Trac support system](https://www.syncfusion.com/support/directtrac/incidents "Link to the Syncfusion support system Direct Trac"). We are always happy to assist you!

If you liked this blog post, we think you’ll also like the following articles:

- [3 Steps to Lazy Load Data in WPF TreeView](https://dev.to/syncfusion/3-steps-to-lazy-load-data-in-wpf-treeview-1i2k "Link to the article 3 Steps to Lazy Load Data in WPF TreeView in MVVM Pattern") [Blog]
- [Build Digital Logic Circuits Easily with Our WPF Diagram Control](https://dev.to/karthickramasamy08/build-digital-logic-circuits-easily-with-our-wpf-diagram-control-59jf-temp-slug-2484682 "Link to the article Build Digital Logic Circuits Easily with Our WPF Diagram Control") [Blog]
- [Prevent Spelling Mistakes in Your WPF Applications](https://dev.to/syncfusion/prevent-spelling-mistakes-in-your-wpf-applications-31ni "Link to the article Prevent Spelling Mistakes in Your WPF Applications") [Blog]
- [_WPF Succinctly_](https://www.syncfusion.com/ebooks/wpf_succinctly "Link to the eBook WPF Succinctly") [Ebook]