I use the TagString of the items in a tableview to store a value which I need tor retrieve a some point in the program.
with tvVideo.Items.Add do
TagString := 'test'
However when I try to use the following code
temp := tvVideo.Items.[tvVideo.SelectedItemIndex].TagString;
TagString is not accessible. Where am I wrong?
TagString is not a property of the item but of the Form. when using With statement you can also access properties beyond the scope.
I need to use a lot of extra information for my items, how can I store this on every item?
I use the next properties:
But I need more properties for saving: Integer, Floats and Strings values
Can you please point me in the right direction to do this?
You need to use DataObject/DataPointer, which points to an object you have created and managed. You can create a TObjectList holding on to the object and then pass it along the item to avoid memory leaks. Then you can store whatever data you want.