Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4608876
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:54:24+00:00 2026-05-22T00:54:24+00:00

How to enumerate a ListView when it is in virtual mode ? I’m using

  • 0

How to enumerate a ListView when it is in virtual mode ?

I’m using OfType<>() method to enumerate the list view items. But its throwing an exception like, the list view can not be enumerated when it is in virtual mode.

Here is my code

List<String> lst= myListView.Items.OfType<ListViewItem>().Select(X=>X.Text).ToList(); 

So how do i get the item from the ListView when it is in Virtual mode?

Please post me a way to use .OfType<>

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:54:25+00:00Added an answer on May 22, 2026 at 12:54 am

    When it’s in virtual mode you can’t get the items out of the list view because the items aren’t in the list view. That’s the whole point of virtual mode.

    Instead, you hold the items and the list view asks for the information it needs to display the items. If you are operating a list view successfully in virtual mode then you almost certainly already have the items in a list somewhere.

    Quoting from the documentation:

    Setting the VirtualMode property to
    true puts the ListView into virtual
    mode. In Virtual mode, the normal
    Items collection is unused. Instead,
    ListViewItem objects are created
    dynamically as the ListView requires
    them.

    Virtual mode can be useful under many
    circumstances. If a ListView object
    must be populated from a very large
    collection already in memory, creating
    a ListViewItem object for each entry
    can be wasteful. In virtual mode, only
    the items required are created. In
    other cases, the values of the
    ListViewItem objects may need to be
    recalculated frequently, and doing
    this for the whole collection would
    produce unacceptable performance. In
    virtual mode, only the required items
    are calculated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to enumerate through arrays using the enumerateObjectsWithOptions:usingBlock method. However, my code rarely
I need to enumerate though generic IList<> of objects. The contents of the list
I can enumerate many features of functional programming, but when my friend asked me
I already bind a listview (grid) with hashtable, so how can I get items
I'm trying to enumerate through all the Controls of a Page, but all I
How can I enumerate methods that have MethodAttributes.PrivateScope using Reflection?
Is it possible to enumerate all main menu items of other programs on Windows?
Is it possible to enumerate sections in latex not just to show 1/2/3 but
I do experiment with LINQ since some time. Typical method to enumerate through a
I have problem when i using ListView and Linq as datasource. The error down:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.