When using TAdvStringGrid combobox (type==edComboList), how to immediately acknowledge the selected value.

I have combobox menus in TAdvStringGrid. When the cell is clicked, and the combobox dropdown menu appears, I make a selection and the selected text is shown in the cell but still with the appearance of the combobox being there. Only until I click another cell will that "combobox look" go away and leave the text in the cell.

I would like my program to know what the selected text was immediately, i.e., before having to exit to another cell.

Looking at the various event triggers, I'm using OnComboCloseup (although I've also tried OnComboChange, et. al.). The events are triggered. But in those routines how can I resolve the text that was selected? Also, can the "combobox look" be removed without having to exit the cell?

Here is an example:

procedure TSchedulerSandboxForm.scheduleGridComboCloseUp(Sender: TObject;
ARow, ACol: Integer);
Format('scheduleGridComboCloseUp triggered in ARow:%d ACol:%d: cell value is [%s]',
[ARow, ACol, scheduleGrid.Cells[ACol,ARow]] )

The debug output shows an empty string instead of the selected combobox line.

Thanks for reading.


Either read out the value from the combobox , i.e. via grid.ComboBox.Text or set grid.MouseActions.DirectComboClose = true

1 Like