Question

I have a ListView in VirtualMode.

I need a way to set focus to specific item.

The FocusedItem is not good for the VirtualMode, I need a way to set FocusedIndex or something like that, but didn't see any property like that.

Thanks.

Was it helpful?

Solution

You have to set the Focused property on the ListViewItem directly.

So, to set the 11th row to be focused:

this.lvVirtual.Items[10].Focused = true;

OTHER TIPS

As it has been said ListView is in VirtualMode. Items collection is not accessible here.

Try to raise an event VirtualItemsSelectionRangeChanged

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top