I'm having some trouble doing a search in a ListView when using VirtualMode. The ListView populates just find using RetrieveVirtualItem event.
I have a text box and "Search" button on my form.
private void btnSearch_Click(object sender, EventArgs e)
{
listViewFields.FindItemWithText(txtSearch.Text);
}
I have handled the SearchForVirtualItem event that looks for the text in my collection and sets the index to the Index property of the event args.
private void listViewFields_SearchForVirtualItem(object sender, SearchForVirtualItemEventArgs e)
{
e.Index = collection.IndexOf(e.Text);
}
The value of e.Index does get set to the expected value but then nothing happens in my ListView.