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.