We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first item to match the letters typed as the selected item
The challenge is handling the scenario when the user enters characters that are NOT in the list. This should indicate that the user has either made a mistake OR wants to enter a new item.
The Combobox is bound to custom types and they have validation rules associated with the property being populated with the selection. We cannot figure out how to identify when the user has typed in an entry NOT IN THE LIST and set the bound property to an invalid value that will trigger the validation.
When a user enters a string of characters that do not represent an item in the list, the selecteditem becomes null. Since the selecteditem is null, the property path bound to the forms datacontext object cannot be identified by WPF and so the binding fails. The business object then retains whatever previous value was set and does not get a new value.