Search code examples
c#listviewvirtualmode

ListView [VirtualMode] change selected index


VirtualMode = true
MultiSelect = false

I can get selected index item, but how change it?

SelectedIndices is readonly.


Solution

  • Not sure if you've found a solution, but I was having the same problem and just came up with this:

    listView1.SelectedIndices.Clear();
    listView1.SelectedIndices.Add(indexToSelect);