ARow: Integer; var CellClassType: TFmxObjectClass);
begin
inherited;
if (ACol = 2) and (ARow > 0) then
CellClassType := TComboBox;
end;
this works fine.
I added items and an onchange event to those comboboxes in GetCellProperties.
In the onchange event of the combobox I want to change and calculate some other cells in that row. However I can't seem to find a reliable way to know which col or row the combobox is located in.
I tried this, but the focused cell is usually not the cell the combobox is in:
sorry, I think I was not clear enough. I don't have a sender, say for example i want to know the itemindex of the combobox in cell [2,2] when i click a TButton on my form. How do I cast cell[2,2] to a Combobox ?
And for disabling a Cell, I want to disable or enable editing for a specific cell in the Tcombobox.Onchange dynamically (depending on the itemindex).
You can use the function TMSFMXGrid1.GetCellObject which returns a TControl based on a cell.
When the itemindex changes you could use a BeginUpdate and EndUpdate to trigger the OnGetCellReadonly which will then disable the cell based on the itemindex retrieved with the GetCellObject function.