We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to filter using Custom SuggestionMode in AutoComplete?

Platform: WPF |
Control: SfTextBoxExt

You can filter by single letter suggestion using Custom SuggestionMode in SfTextBoxExt control.

Create a Custom filter

Create a delegate method matching the predicate <string, T> for filtering suggestions.

Set SuggestionMode and Filter property

Set the property SuggestionMode=”Custom” and the delegate method for Filter property.


<Window x:Class="AutoComplete_132047.MainWindow"        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        Title="MainWindow" Height="350" Width="525">
        <input:SfTextBoxExt AutoCompleteSource="{Binding Items}" SearchItemPath="Name" AutoCompleteMode="Suggest" SuggestionMode="Custom" x:Name="autoComplete"/>



public partial class MainWindow : Window
        public MainWindow()
            autoComplete.Filter = Filter;    
        private bool Filter(string text, object item)
            if ((item as Model).Name.Contains(text))
                return true;
                return false;
public class Model
        private string name;
        public string Name
            get { return name; }
            set { name = value; }
    public class ViewModel
        private List<Model> items;
        public List<Model> Items
            get { return items; }
            set { items = value; }
        public ViewModel()
            items = new List<Model>();
            items.Add(new Model() { Name="A" });
            items.Add(new Model() { Name = "AA" });
            items.Add(new Model() { Name = "AB" });
            items.Add(new Model() { Name = "AC" });
            items.Add(new Model() { Name = "A1" });
            items.Add(new Model() { Name = "B" });
            items.Add(new Model() { Name = "C" });
            items.Add(new Model() { Name = "D" });
            items.Add(new Model() { Name = "E" });

The above code filters using single letter suggestions and the screenshot is as follows.



Figure 1: AutoComplete using Filter

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment
Dec 31, 2020

How can you access the "Filter" property of the SfTextBoxExt in MVVM?


Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile