How do I create a column in a TStringGrid in FireMonkey that displays the row number?
If it's by using a LiveBinding, I can't figure out how.
Your forms/grids OnGetValue event handler is passed the row as one of it's parameters. Simply verify the column is the one you want and return the row number.
function Form1.Grid1GetValue(const Row, Col: Integer): TValue;
begin
if Col = 0 then
Result := TValue.From<Integer>(Row);
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With