I have a listview that contains a checkbox, Div, UserID. I am using this to make a txt file of all the ones that are checked. The problem is that the listview contains around 100,000 entries which already takes about 7 seconds to load and I need to take the entries from the text file that are saved Div~UserID and search through the listview and check the ones that are already in the file.
Here is how I am doing it now
For j = 0 To intCounter - 1
For i = 1 To .ListItems.Count
.SelectedItem = .ListItems.Item(i)
If .SelectedItem.ListSubItems(1) & "~" & .SelectedItem.ListSubItems(2) = varArray(j) Then
.SelectedItem.Checked = True
i = .ListItems.Count
This is extremly slow being that it has to go through the entire listview until it finds the correct one.
I was wanting to use the .finditem method but cant seem to get it to work when there are duplicates. It always just selects the first one and that is it. I did notice object.FindItem (string, value, index, match) and that index can supposly by a key. When I am loading the list I make the Key = Div~UserID but when I try to set the index = to that string for the key it gives a type mismatch. Even though it says the string is the value of the Key property for what the index is.
Any ideas to help speed up performance?