Question : VB.NET: listView find item (exact string)

Hi X-perts,

I need a fast code to find an item in ListView (without looping, if possible). I am using the following code now. The problem is that FindItemWithText always finds the 1st substring occurrence, but not the exact match.

any solutions that wouldn't imply looping throughout the listview items?

Thanks
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
For Each f In rc.Fields
                    Try
                        j = Me.ListView1.FindItemWithText(f.Name).Index
                        If (j <> -1) Then Me.ListView1.Items(j).Checked = True
                    Catch ex As Exception
                    End Try
                Next

Answer : VB.NET: listView find item (exact string)

sort it first, so it finds exact match first ;)
Random Solutions  
 
programming4us programming4us