-1

How I can make an Autocomplete Text Field in WPF? How I can include multiple value in text field. Actually I'm trying to make an search bar in which Products are fetched from database and include in text field then.When i type a keyword it should be display an suggestion.

Clemens
  • 123,504
  • 12
  • 155
  • 268
Shahbaz
  • 65
  • 1
  • 1
  • 8
  • 2
    Possible duplicate of [AutoComplete TextBox in WPF](http://stackoverflow.com/questions/950770/autocomplete-textbox-in-wpf) – Sinatr Feb 06 '17 at 11:22
  • @Sinatr It is working in combo Box but the problem is how i can do within Text field? – Shahbaz Feb 06 '17 at 11:25
  • ComboBox = TextBox (edit) + Popup (suggestion list). What is Text Field? – Sinatr Feb 06 '17 at 11:26

1 Answers1

0
  1. Re-template ComboBox to make it looks like TextBox.
  2. Extend ComboBoxItem so that we can hightlight the already entered part in the dropdown list.
  3. Get reference to the TextBox part of the ComboBox, and hook up TextBox.TextChanged event.
  4. In the TextBox.TextChanged event handler, we filter the underlying datasource and create new list source with our customized ComboBox Items.

Hope this will be helpful.

Thank you