ListView subitem

  • Thread starter Thread starter Larry Hilley
  • Start date Start date
L

Larry Hilley

I have a listview that I need to get the text in a subitem in a selected
item (line).
I can get the selected item index, but I can not get the data back from the
subitem.
If you can point me to an example or tell me how to do it that would be
great!
The is managed C++ but C# will do.

Thanks!
Larry Hilley
 
myListView.SelectedItems(0).SubItems contains
all subitems for the first selected item

/claes
 
Hi, thanks for the help.

I tried to find the C++ version of your code but could not.
I did make it work, and I am sure there is a better way, but here is
what worked.

ListViewItem * subitem1;
subitem1 = listView1->Items->get_Item(k);
String* mysubitem = subitem1->SubItems->get_Item(4)->Text;

where listView1 is my litview
k is the selectef line index
4 inst index to the forth subitem

Thanks again, Larry Hilley

PS: Someone please write a book with real programs for examples. All I
found just setup the list view and did not use it.
 
Back
Top