I have a few AutocompleteBoxes databound to some objects (standard MVVM pattern).
If I make a selection, then press the Tab key, the objects are updated just fine.
If I just click to another control, they are not. The lose focus event is fired, but the Selecteditems is null.
Is there a way to make this work properly?
5 Answers, 1 is accepted
Hello Eric,
I've prepared a small sample to test this, but I wasn't able to reproduce the reported behavior. Can you please check the attached project and let me know if I am missing anything?
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
Hi
I downloaded your test app, it gets a null reference exception as soon as I try typing Item in the autocomplete box
Hello Eric,
I've double checked the project, but there is no error on my side. Can you check if you are using the latest version of UI for WPF? Also, can you double check if there is no mixture between Xaml and NoXaml dlls? The project was designed using the Xaml version of the Telerik dlls.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.
OK,
Had to switch to Xaml.
Can now repro issue. Start typing "Item", then click on your Focus Textbox (without explicitly choosing an item from dropdown list). Item 1 shows in the Autocomplete box but it is not selected
I *know* I need to actually choose an item, but it is confusing a number of our users. It is also less obvious when there is only one choice - for instance I changed your list to "Item 1","Jtem 2" and "Ktem 3". now type "I" - you get Item 1 in dropdown, but as mentioned you click anywhere else Item 1 is left in Autocomplete box, but it is not selected.
I guess is there a programatic way to force the selection of the search text when the control loses focus (provided that it actually matches something)?
Hello Eric,
Thank you for the clarification.
If you want to avoid appending the suggestion when you type in, you can set the AutoSuggestMode to Suggest (the default one is SuggestAppend). This way it should be more clear to the end user what happens. If this doesn't work, you can manually select the suggestion when the focus is lost. I've updated my last project to show this approach. I hope it helps.
Regards,
Martin Ivanov
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.