I’m not sure I understand.
ItemIndex is the index of the row in the dropdown list. The active row or selected row is indicated by DBAdvSearchEdit.ItemIndex
I have one DBAdvSearchEdit component connected to a customer listsource.
This listsource has two fields (customer_name and customer_id)
In the DBAdvSearchEdit, I have created two TColumnItems for each field:
TColumnItems[0] for the customer_name and TColumnItems[1] for the customer_id
When the user choose a customer in the list, I want to retrieve the customer_id from TColumnItems[1] ?
(DBAdvSearchEdit.Datasource and DBAdvSearchEdit.Datafield are empty for this case.)
From the OnSelect event, you could have an event handler like:
procedure TForm1.DBAdvSearchEdit1Select(Sender: TObject); var id: string; begin id := DBAdvSearchEdit1.Items[DBAdvSearchEdit1.ItemIndex].Captions[CustomerIDColumn]; end;