selected item in TAdvSearchEdit?


I'm trying to simulate a search edit like the one in Office 365 that let you search "what to do":

I'm using an AdvSearchEdit to dinamically load all toolbar button captions and hints and list them. It works fine, but I don't know how to get the selected item in the combobox, so I can then show related help or execute the action:


Is there any other component I could use for this? (I need to get the button Image, caption and notes). Is it posible to get the selected item in the AdvSearchEdit?


You can retrieve this via:

AdvSearchEdit1.SearchList.SelectedItem.Index: integer;
Hi again

I'm retrieving the selected item in AdvSearchEdit1.SearchList in the DropUp event. The problem is that, every time I dropup it without selecting an item, I'm getting the last item I selected.

I explain:
- I dropdown the list and select an item
- I get the selected item in dropup event. Perfect
- I dropdown again BUT don't select anything
- I'm getting the same (previous selected) item because it remained selected.

How can I 'deselect' the current selected item in AdvSearchEdit1.SearchList before dropping it to avoid this? Or is there any other method to know if I selected an item or not?


Did you set

AdvSearchEdit.FilterCondition.AutoSelect := false?

That helped, but fifty-fifty...

I clear the selection in the BeforeDropDown event with:

and with "AutoSelect = false" it works fine, but if I use the mouse scroll or keyboard cursors to navigate the list, then an item is selected automatically. Then, if I click OUTSIDE the AdvSearchEdit (I mean, I don't want to select any item in the list), then an item remains selected.

I only want to select an item if I click on it in the list, or if I press Enter for example.
Maybe something like an 'OnItemClick' or an 'OnSelectItem' is what I'm trying to simulate?

Well, it is by design that keyboard & mouse scroll interacts with this list. This behavior is modeled after how a TCombobox behaves, so I think that doing it different would make it non-intuitive.