WebComboBox not "selected" when pressing the Enter key

If I add code to the .selectionchanged event of a WebComboBox the event fires correctly if the user “clicks” the selected item but if the user types something and then hits the Enter key the selection list is hidden but nothing seems to have been selected. For example the following code works correctly if the user clicks on an item on the list but fails if the user hits return.

Var MySelection As String = Me.RowValueAt( Me.SelectedRowIndex )
Self.SelectionTextField.Text = MySelection

Perhaps I’m missing something so any help is appreciated.

Correct. SelectionChanged only fires if the user selected something from the menu. If they are typing, it will be reflected in TextChanged.

1 Like

Ok thanks for answering but the thing is how would I go around “selecting” the row in the .TextChanged event?

Self.SelectionTextField.Text = Me.RowValueAt( Me.SelectedRowIndex )

I would have thought something like this would work but it does not. What would be the way to do this?

You don’t. The textChanged event should fire when the user types something and the SelectionChanged event should fire when the user selects from the menu.

In my opinion one should be able to select when typing only. Graffitisuite’s popupMenu has this functionality. All good as I own a license for GS, sucks for those who don’t.

2 Likes

I just went into this issue. I have a WebComboBox prefilled with tags and want to user to be able to select a pre-existing one or just enter a new one.

The WebComboBox is missing a “KeyPressed” event to catch when the user is pressing the Enter key. Also, the WebComboBox should make it possible for the user to select one of the suggestions with the arrow keys.

Any tips appreciated.

Update: I found a hack to work around the missing “KeyPressed” event: when I place a WebButton with Default = True in the page, it catches the Enter key and fires. However, when I make the Button invisible, it doesn’t. So I “hide” it behind another control and keep it visible.

1 Like