Hi,
under certain circumstances, RadAutoCompleteBoxes (at least in the "SuggestAppend" mode) have a discrepancy between what is displayed and what is actually selected/in their SearchText property.
Steps to reproduce:
- Execute the attached project
- Focus the AutoCompleteBox on the top left.
- type the number zero (0) (for demo purposes, all items have names that look like 00001, 00002, 00004, ...)
- You should now see the Dropdown opening and the suggestion mechanism beginning to suggest the first item in the list. You should also see that the SearchText property that is bound to ViewModel contains the single zero you just typed. The selected item is still NULL as expected.
- Now, instead of typing anything else, click out of the AutoCompleteBox and focus another control (I added the WatermarkBox on the right side to allow for that)
- This is the point where the discrepancy occurs: The viewmodel still only sees the zero you typed and no item is selected. BUT: the AutoCompleteBox now shows the full item name as if it was selected correctly, see the attached screenshot.
As a user who does not have the controls on the right side to show me what is actually happening under the hood, I have no chance of knowing what is actually selected (and if anything is selected at all). To me it looks like the AutoCompleteBox just selected the first item for me. If this is what I wanted, I would have no reason to think that nothing is actually selected.
Since the ViewModel does not know anything about the additional text that is displayed, I (now as the programmer) have afaik no chance to add a workaround that selects the corresponding item when the control loses focus.
What I think it should look like:
There are two possibilities:
1. As soon as the control loses focus, the suggestion should disappear, leaving me with a single zero in the text box and nothing selected.
2. There could be a second property where I can bind to the full text in the textbox (including the suggestion) so I as the programmer can decide what to do with the suggestion once the control loses focus.
Best regards
Simon Müller
Hofmann Fördertechnik GmbH
PS.: If you click back into the AutoCompleteBox after defocusing it, you can then actually edit the suggestion as if it was text you inserted in the first place. But only after your first key press, the ViewModel is updated to the full string that is displayed in the textbox.