Articles in this section
Category / Section

How to enable autoappend suggestions in Autocomplete control?

1 min read

The suggested item can be appending automatically in the textbox, using IsAutoAppend property. When the property is set as true, the suggested item can be appended.

XAML

<syncfusion:AutoComplete x:Name="autocomplete" Height="30" Width="180" Source="Custom" 
                         IsAutoAppend="True" DisplayMemberPath="item">
  <syncfusion:AutoComplete.CustomSource>
      <local:AutoCompleteList/>
  </syncfusion:AutoComplete.CustomSource>                       </syncfusion:AutoComplete>

 

C#

    public partial class MainWindow : Window
    {
        AutoCompleteList obj = new AutoCompleteList();
        public MainWindow()
        {
            InitializeComponent();
            autocomplete.CustomSource = obj;
            autocomplete.SelectionMode = SelectionMode.Extended;
            
        }
    }
    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 = "item 4" });
            this.Add(new AutomComp() { item = "item 5" });
            this.Add(new AutomComp() { item = "item 6" });
        }
    }
 

 

Screenshot:

 

AutoAppend.png

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