• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 286
  • Last Modified:

Whats wrong here? (ListViewItemCollection and Item)

I'm having a problem with this code


ListView.ListViewItemCollection tracksOnComputer = this.locationFilesListView.Items;
//get the item in the list at position 1
ListViewItem selectedTrack = tracksOnComputer.Item(1);

When i compile this, i get:

'System.Windows.Forms.ListView.ListViewItemCollection' does not contain a definition for 'Item'

I thought i was on the right lines, but whats up?
0
pee_cee
Asked:
pee_cee
1 Solution
 
PeteMcCommented:
Use this instead should make it right
ListViewItem selectedTrack = tracksOnComputer[1];
0
 
pee_ceeAuthor Commented:
Sorted. Thanks.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now