6 Incredible Features of WPF AutoComplete Text Box | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (175).NET Core  (29).NET MAUI  (208)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (220)BoldSign  (15)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (67)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (101)Streamlit  (1)Succinctly series  (131)Syncfusion  (920)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (37)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (151)Chart  (132)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (633)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (41)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (508)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (597)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
6 Incredible Features of WPF AutoComplete TextBox

6 Incredible Features of WPF AutoComplete Text Box

Our Syncfusion WPF AutoComplete text box control is a complete 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. It can also be used as a multiselect combo box by enabling the multiselect mode in it.

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:

WPF AutoComplete text box
WPF AutoComplete text box

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, which filters the suggestions when the beginning of the string has matches in the list.

The Contains 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.

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

Refer to the following screenshot.

Contains filtering option in WPF AutoComplete
Contains filtering option in WPF AutoComplete

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 or by simply dividing them with a delimiter. To do so, we have to set the MultiSelectMode 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.

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

Refer to the following GIF image.

Multiselection mode in WPF AutoComplete
Multiselection mode in WPF AutoComplete

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, users can choose whether to highlight a single instance or multiple occurrences of the character typed.

Refer to the following code example.

<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
Text highlighted in WPF AutoComplete suggestions list

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 property to Custom. Users can also define a custom filter and assign it to the Filter property.

Refer to the following code example.

{
     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
Multipath search in WPF AutoComplete

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.

Refer to the following code example.

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

Refer to the following screenshot.

Diacritic sensitivity in AutoComplete
Diacritic sensitivity in AutoComplete

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  property to true.

Refer to the following code example.

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

Refer to the following screenshot.

AutoComplete text box as ComboBox
AutoComplete text box as ComboBox

Conclusion

Thanks for reading! In this blog, we have covered the top six features of our Syncfusion WPF Autocomplete control to improve your application. Refer to our UG documentation to learn about all the available features. You can also try our WPF AutoComplete demos.

If you aren’t a customer yet, you can try our 30-day free trial 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 forumfeedback portal, or Direct-Trac support system. We are always happy to assist you!

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

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed