I have a listview working in virtual mode, in the LargeIcons view. Retrieves are expensive, so I want to ask for the data for all the visible items. How do I get the start
You could iterate through subsequent items, checking their visibility until you reach the one that isn't visible. This would give you a count of the visible items.
For example, something like:
for (int index = 0; index < list.Items.Count; index++)
{
if (list.ClientRectangle.IntersectsWith(item.GetBounds(ItemBoundsPortion.Entire)))
{
// Add to the list to get data.
}
else
{
// We got them all.
break;
}
}
I'm not sure what effect sorting would have on this though.