Are you sure you are willing to allocate all those objects? By the look on the record structure it looks like you want an object per row - not per cell. To do that you have at least 2 options:
- (My favorite because of the freedom it gives) You use TDrawGrid instead and draw the content of your cell manually. It's really not that hard!
- You make an object that encapsulates this record. It's an easy one as well, like for example:
type
TMyRec= packed record
FullName : string[255];
RelativePath : boolean;
IsInvalid : boolean;
end;
TMyData = object (TObject)
private
FData: TMRec;
public
constructor Create(AData: TMyRec);
property FullName: String read FData.FullName write FData.FullName;
property RelativePath: Boolean read FData.RelativePath write FData.RelativePath;
property IsInvalid: Boolean read FData.IsInvalid write FData.IsInvalid;
end;
...
constructor TMyData.Create(AData: TMyRec);
begin
FData := AData;
end;
Now whenever you want to hook up your data to the grid you just pack it into that object and you can then use the Objects collection.
Now instead of going through all that hassle just create an event handler for TDrawGrid.DrawCell like
procedure TMainForm.GrdPathsDrawCell(Sender: Object; ...);
use GrdPaths.Canvas.Handle with DrawText or if Unicode is needed use DrawTextW (both come from Windows API so there's tons of examples of how to use it) and you'll save you and your client a lot of frustration, memory and above all - time.