Enter at the AutoCompleteBox

Editors for WPF Forum

Posted 1 year ago by mase
Version: 22.1.4
Avatar

If enter is pressed for the AutoCompleteBox, the box always takes over the selectedItem. That's actually a good thing.
Is there still the possibility to accept the entered text with "Enter" in the AutoCompleteBox and not the selectedItem.

The problem is that under certain circumstances no new entry can be created. Example:
Items:
-BostonCeltics
-BostonBruins

If I enter only Boston, the selected entry is always transferred to the box.

Comments (2)

Posted 1 year ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The event args passed to the AutoCompleteBox.Submitted event will have e.Text, which is the text that comes from the selected item (in e.Item).  The event args also has e.OriginalText, which is the typed text.  That property should contain "Boston" in this case and you can take action to add an item in response.  You can also update the AutoCompleteBox.Text property from that event args too.  We show an example of that in the related QuickStart.


Actipro Software Support

Posted 1 year ago by mase
Avatar

Hello,

many thanks for the answer!

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.