Access ListView item text (FMX)


I have a TListView and when the user clicks on the image of an item (big green dot in picture below) i want to copy the item text (“russtest.cfg”) and subitem text (“My Device, 1991”) to display in a ShowMessage. I can’t find how to do it in C++ Builder but this link shows how in Delphi.

Below is the code i’ve tried in the TListView’s ItemClickEx method:

TListItem* item;
item = ListView1->Items->Item[ItemIndex];
UnicodeString s;
s = item->ToString();

But it brings back this:

EDIT 1: Added the code i use to populate the ListView:

TListViewItem* item2Add = Form1->ListView1->Items->Add();
item2Add->Text = mystring3; // e.g. “russtest.cfg”
item2Add->Detail = mystring2; // e.g. “My Device, 1991”
item2Add->ImageIndex = 1; // big green dot

Comments are closed.