CollectionView scroll if selected item not visible

Hi,

I select an Item by code:

ACollectionView.SelectItem(ASection,ARow,spCollectionViewScrollPositionNone,false);

This item can be outside the visible area.
Only when the selected item is not visible on screen I want to scroll to it:

if ItemNotVisible then begin <- ?

  if ARow < AOldRow then
    ACollection.ScrollToItem(ASection,ARow,spCollectionViewScrollPositionTop,true)
  else
    ACollection.ScrollToItem(ASection,ARow,spCollectionViewScrollPositionBottom,true);

end;


How can I implement the function ItemNotVisible ?

Thanks in advance,
Dietrich

ACollectionView.visibleItems seems to be emty at all times ...

It seems very strange that VisibleItems is empty at all times. This should at least be filled with the visible items. Can you log the contents, or the count?

sorry,

Count(ACollection.visibleItems) gives the number of visible items!
again sorry:

Length(ACollection.VisibleItems)