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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to Filter the items in AutoComplete Control?

Platform: WPF |
Control: AutoComplete |
Published Date: November 12, 2015 |
Last Revised Date: June 24, 2019

Autocomplete control allows to filter the items by IsFilter Property.

It can be enabled or disabled by setting the IsFilter value of Autocomplete as True or False respectively.

The same has been explained in the following code snippet:

XAML:

//Code Explains how to filter the items in Autocomplete control
<Window x:Class="AutoComplete.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AutoComplete"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Title="MainWindow" Height="350" Width="525">
<Grid>
<syncfusion:AutoComplete x:Name="Autocomplete" SelectedIndex="0" IsFilter="False" Source="Custom" HorizontalAlignment="Center" Height="40" DisplayMemberPath="item" CustomSource="{Binding item}" VerticalAlignment="Top" Width="150" Margin="176,125,177,0" >
</syncfusion:AutoComplete>
</Grid>
</Window>

C#:

//Code explains how to filter the items in AutoComplte control
namespace AutoComplete
{
public partial class MainWindow : Window
{
AutoCompleteList obj = new AutoCompleteList();
 public MainWindow()
{
InitializeComponent();
Autocomplete.CustomSource = obj;
}
}
public class AutomComp
{
 
public string item { get; set; 
}
public class AutoCompleteList : List<AutomComp>
{
public AutoCompleteList()
{
this.Add(new AutomComp() { item = "item 1" });
this.Add(new AutomComp() { item = "item 2" });
this.Add(new AutomComp() { item = "item 3" });
this.Add(new AutomComp() { item = "eitem 4" });
this.Add(new AutomComp() { item = "sitem 5" });
this.Add(new AutomComp() { item = "item 6" });
}
}
}

 

Output:

Filter Enable

C:\Users\Ashok.Murugesan\Desktop\Switchmode\AutoCompleteControl(IsFilterEnable).png

Filter Disable:

C:\Users\Ashok.Murugesan\Desktop\Switchmode\AutoCompleteControl(IsFilterDisable).png

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

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