How to get the value of the selected row from the ListView?

  • At least show some code. So by selecting a line you get its ordinal number and by it you get a value from the data array for the list. Or even it will come to callback. It all depends on the code / implementation - YuriySPb
  • some text will give you a ListView.Selected.Text or Listview.Selected.Details - teran
  • may need to be brought to TListViewItem(ListView.Selected).Text - teran

1 answer 1

Since this is FMX , not VCL , according to the documentation , you should use the Selected property to get the selected list item (if nothing is selected, it returns nil ).
In general, speaking of this framework, your list items can look as you please and contain any data. But in the standard view, to get the text of the element, use the Text property.

 SelectedItemText := TListViewItem(TListView1.Selected).Text; 

There is also a detail property for add. text.