Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Find items in ListView

Posted on 2004-04-11
3
Medium Priority
?
390 Views
Last Modified: 2008-02-01
Hi,

Can anyone please let me know how to search listview items in vb.net. I have a listview whose items are populated with strings. I need to compare the listview items with strings. For every match, I need to get the index of the listview item and select it.

Thanks in advance,
Pratibha

0
Comment
Question by:pratibharao
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 19

Accepted Solution

by:
Fahad Mukhtar earned 300 total points
ID: 10803709
Dim lv As ListViewItem
For Each lv In ListView1.Items
            If lv.Text = "MatchingString" Then
                lv.Selected = True
                ' MsgBox(lv.Index) 'at the end of this loop the ListView1.SelectedIndices will contain all the selected rows in LV
            End If
Next
0
 

Expert Comment

by:kantrishi
ID: 11126025
By putting above mentioned code, we have to pass exact matching string to find, i would like to know is there any method so that we can send partial string so that we could find number of row for partial match

Thanks and regards,

Rishi Kant
0
 
LVL 27

Expert Comment

by:Dabas
ID: 13178314
Hi pratibharao:
This might be of help:

http://www.codeproject.com/useritems/LVFind.asp

Dabas
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Loops Section Overview

610 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