Getting value of last item in listview?

  • Thread starter Thread starter Jozef Jarosciak
  • Start date Start date
J

Jozef Jarosciak

Hey guys,
I have a listview with 7 collumns and I need to retrieve value from the
first line and its 7th collumn.
Is there an easy way to retrieve it?
Thanks,
Joe
 
Hi Joe,

I don't know of any particularly easy way to do it. You need to work your way through using indexers, which is easy enough.

ListViewItem.ListViewSubItem sub = listView1.Items[0].SubItems[6];

or

string s = listView1.Items[0].SubItems[6].Text;
 
if this works:
string s = listView1.Items[0].SubItems[6].Text;
, that would be the perfect answer. I will give it a try.
Joe
 
Back
Top