DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: How to select all items in ListView?

  1. #1
    Join Date
    Oct 2004
    Posts
    7

    How to select all items in ListView?

    Hi Dude,
    I just want to know,it it there is way to select all item in listview.Let say I have 10 item in my list view.How can I select all the item at one time.

    Thanks.

    Izman Haidi,

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    If you only have 10 items, you can do this:
    Code:
    MyListView.MultiSelect = True
    
    Dim item As ListItem
    For Each item In MyListView.ListItems
        item.Selected = True
    Next
    If you have hundreds of items, that method may be too slow. You can do this instead: http://www.mvps.org/vbnet/code/comctl/lvselectall.htm
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Oct 2004
    Posts
    7
    thanks.dude.I finally got the solution.

  4. #4
    Join Date
    Dec 2013
    Posts
    24
    I am also curious about and interested in this question. The suggestions here sounds helpful, I'd like to take a try to solve my ListView item selection problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center