Page 1 of 1

Attaching Structures to StringGrid Rows

PostPosted: May 21st, 2003, 4:01 pm
by everclearmind
I have a little problem, i have created a linked list using a structure called TProduct, but what i'm trying to accomplish is to attach a TProduct structure Node to each row of a StringGrid componet, so when a user selects the row, it will be able to reference the TProduct directly instead of requiring any search algothrums. Could anybody help me PLEASE!!! :roll:
I assume you might be able to use TObject inside the class of TString, but am quite confused.

Thank you,

TStringGrid.Objects[]

PostPosted: May 30th, 2003, 1:37 pm
by richardchaven
Use the TStringGrid.Objects[Col, Row] property to store objects.

Note: you must have text in the Cells[Col, Row] or the object pointer goes away too; you can have a single space, but it cannot be an empty string.

I agree that having a separate list of objects (in order to free them all) is much better than iterating the Objects property and freeing anything you find.

BTW: why a linked list instead of TCollection?

Cheers