Hello:
I create a new sample project (Delphi, Multi Device App).
I put a FMXGrid on it, and changed the Editor property to ComboBox in Columns 1 and 3.
I also placed 2 labels called Label1 and Label3 (to be in order with the columns chosen for the example) at the bottom of the columns.
I fill the combos values in the Form.OnCreate event.
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
TMSFMXGrid1.Columns[1].ComboItems.Clear;
for i := 0 to 9 do
TMSFMXGrid1.Columns[1].ComboItems.Add(IntToStr(i));
TMSFMXGrid1.Columns[3].ComboItems.Clear;
for i := 0 to 9 do
TMSFMXGrid1.Columns[3].ComboItems.Add(IntToStr(i));
end;
Then I put some code in the ComboCloseUpeven for column 1 and CellEditDone for column 3.
procedure TForm1.TMSFMXGrid1CellComboCloseUp(Sender: TObject; ACol, ARow,
ItemIndex: Integer; AValue: string);
begin
if (ACol = 1) and (ARow = 1) then
Label1.Text := TMSFMXGrid1.Cells[ACol, ARow];
end;
procedure TForm1.TMSFMXGrid1CellEditDone(Sender: TObject; ACol, ARow: Integer;
CellEditor: TFmxObject);
begin
if (ACol = 3) and (ARow = 1) then
Label3.Text := TMSFMXGrid1.Cells[ACol, ARow];
end;
The right value is never shown in neither case.
You can see a video of this application running in the following video:
I'm sure I'm doing something wrong but I don't know what.
Thank you.