Hi there, I'm using a ListView to show Items in a List. The user can select the items himself, or use some 'preselect keys' to select items with specified attributes.
To check the items I use something like that:
for(int i;i<MyListView.Items.Count;++i)
{
if( /*... Check if the items should be selected ...*/ )
(MyListView.ItemContainerGenerator.ContainerFromIndex(i) as ListViewItem).IsSelected = true;
}
This works perfectly for items, that are visible at the time of excecution. But for items, that are not visible, ContainerFromIndex() returns null. I heard this has something to do with virtualization, and that the List doesn't know about items upside or downside the 'field of view'. But how comes that it is possible to have selected items in the List offside the 'field of view' when you select them manually?
And how to do a select of an item outside 'field of view'? I think that must be possible.
Thanks for any help, Marks