This question appears to have been answered already, possibly by MonkeyStyler/Mike Sutton, however, as I am using Delphi 10 Seattle, provided code and guides don’t work anymore. Specifically
firemonkey grid basics
doesn’t work because the ApplyStyling event handler is only called once now (at column create)
I want to add a TCombobox or TComboboxEdit column to aTGrid.
type
TComboColumn = Class(TColumn)
protected
function CreateCellControl: TStyledControl; override; // works!
End;
…
Grid1.AddObject(TComboColumn.Create(Grid1));
…
function TComboColumn.CreateCellControl: TStyledControl;
begin
Result := TComboBox.Create(Self);
TComboBox(Result).Items.Add(‘A’);
TComboBox(Result).Items.Add(‘B’);
TComboBox(Result).Items.Add(‘C’);
TComboBox(Result).OnChange := DoTextChanged; // strange hooks
end;
This creates the combobox column in the grid, but it’s the same combobox in every row, and I have no idea how to add the GetValue and SetValue methods applicable here.