Delphi Firemonkey TGrid usage


I’m attempting to use a TGrid in the Delphi Firemonkey GUI library and I’m falling pretty badly on my face here.

At this point in time, I have a TGrid in my form which three cells, a string cell, and 2 checkbox cells.

At current execution, the Grid show up, with the three separate columns. However, nothing gets saved to the string cell and the checkbox cells do not appear unless you double click the cell. When you click away from the checkbox cell, the checkbox disappears.

I figure that I’m missing some crucial step here. I found a function for the TGrid class, OnGetValue and OnSetValue. I figure these must have something to do with my problem, but the issue is I have absolutely no idea how to use them.

Each calls for a (Sender: TObject; const ACol: Integer; const ARow: Integer; const Value: TValue)

I’m making an assumption with the sender, like when creating events for other controls, you’re passing in self as the parameter of Sender. ACol and ARow are pretty obvious. But I’m lost with the TValue parameter, as I can’t seem to figure out what the heck TValue is. Embarcadero provides this documentation for TValue, but it doesn’t tell me a lot that is useful.

At this point, I’m just trying to simply get a cell to show its value and not lose its value when you click away. I know I must be missing something, but I just don’t know where to look. It feels like all the questions on this website and others relating to TGrid for Delphi are grossly outdated (I’ve seen them stretching all the way back to 2003).

Comments are closed.