Whats wrong here? (ListViewItemCollection and Item)

Posted on 2005-04-09
Last Modified: 2008-02-01
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?
Question by:pee_cee
    LVL 2

    Accepted Solution

    Use this instead should make it right
    ListViewItem selectedTrack = tracksOnComputer[1];
    LVL 3

    Author Comment

    Sorted. Thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now