WPF-AutoComplete-TextBox icon indicating copy to clipboard operation
WPF-AutoComplete-TextBox copied to clipboard

System.NullReferenceException

Open rrFK opened this issue 3 years ago • 0 comments

If the items for the AutoCompleteTextBox are loaded from a database, a System.NullReferenceException is thrown in the GetSuggestions(string filter) method after typing a character into the text box. In the lambda expression, x is null.

Here is the full method: public IEnumerable GetSuggestions(string filter) { return items.Where(x => x.Contains(filter)); }

rrFK avatar Apr 29 '22 08:04 rrFK