0

I've seen a number of suggestions for AutoComplete in WPF on a TextBox. However, they are all years old by now and many are expired without working websites.

Basically, I'm going to want to bind the TextBox to an ObservableCollection with a Model of a Person. Their Name will be displayed wen the user types as a suggestion, and will be displayed when the user selects said Person.

However I also want to be able to access the selected Persons ID as well. Is there a TextBox that is still current and can achieve what I would like it to do?

EDIT: I've attempted to use WPF TextBox AutoComplete like so:

<TextBox Text="{Binding SelectedItem.ContactMadeBy, ElementName=contactsDataGrid, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" behaviors:AutoCompleteBehavior.AutoCompleteItemsSource="{Binding EmployeeCollection}"/>

but nothing happens when I type. I've looped through EmployeeCollection and it is definitely populated, so the issue lies with the TextBox. An additional problem to this is that it needs to be bound to an IEnumerable<string> where I can't have the Persons ID as well.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
CBreeze
  • 2,925
  • 4
  • 38
  • 93
  • There is no `AutoCompleteTextBox` in wpf. You have to either use someone's or create own control. Show what you done, what doesn't work (how you want it to work) and question may become less [duplicate](http://stackoverflow.com/q/2338690/1997232)/broad. – Sinatr Feb 03 '16 at 15:25
  • @Sinatr I've updated my answer to show what I've tried so far. – CBreeze Feb 03 '16 at 15:38

0 Answers0