Grid: How To Add columns of pictures in ComboBox

Hi,


FireMonkey C++

I have been searching the net and docs for how at run time to add a ComboBox to a grid cell in a TMFmxStringGrid, having two columns, and three rows - I can add the ComboBox, but not include;

Column1: A TImage.

Column2: Text

And how to change the image and text at runtime.

So far I found that this might be done by using a TStringList, but trying to do so gives no expected result.

Any help on this is very much appreciated, since after a full day of research, I found no info of how to do this.

Thanks !



Hi, 


There is a built-in editor etComboBox that can be returned per cell as a type in the OnGetCellEditorType event. 

procedure TForm1.TMSFMXGrid1GetCellEditorType(Sender: TObject; ACol,
  ARow: Integer; var CellEditorType: TTMSFMXGridEditorType);
begin
  CellEditorType := etComboBox;
end;

You can fill the combobox with values before the editing is started in the cell in the OnGetCellData:

procedure TForm1.TMSFMXGrid1GetCellData(Sender: TObject; ACol, ARow: Integer;
  var CellString: string);
begin
  TMSFMXGrid1.CellComboBox.Items.Clear;
  TMSFMXGrid1.CellComboBox.Items.Add('test');
end;

Kind Regards, 
Pieter