In C++Builder 11.2, I'm working on an FMX TStringGrid
with a TPopupColumn
to let the user select one item from a list that is completed at runtime. Each row of this grid has a different kind of data type, so the items on this column must be different for each row: string, integer, date, etc, as for example on a composed filter dialog.
But, I want to add three behaviors that this TPopupColumn
doesn't have:
allow the user to write new text in addition to making a selection of one of the available items;
allow the user to type some text to find the most similar item;
allow the user to scroll the list of items when it is longer than the dialog.
These behaviors are typical of a TComboEdit
, but unfortunately the TStringGrid
doesn't have any equivalent column like a TComboEditColumn
that I can use for this purpose, AFAIK.
I don't know how to add those behaviors.
Can someone show me how to add/publish the scroll and edit properties to the TPopupColumn
, or suggest another way to do this?
Just in case someone is interested, this is the code to complete at runtime the ‘Valor Desde’ TPopupColumn
items for one row of the StringGrid_Filtrado
. The items available on the fCamposDatos
class were previously populated from a query:
TPopupColumn *PupColDesde = dynamic_cast<TPopupColumn*>(StringGrid_Filtrado->Columns[3]);
for (int i = 0; i < MaxValoresCampoDato; i++) {
if(fCamposDatos->fCampoDato[IdCampoDato].fValoresCampoDato[i].Valor != "") {
PupColDesde->Items->Add(fCamposDatos->fCampoDato[IdCampoDato].fValoresCampoDato[i].Valor);
}
}