0

I have a virtualized ListView filled with at least 500 items having different heights of each ListViewItem. ListView Properties set as:

<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden"/>         <Setter Property="ScrollViewer.CanContentScroll" Value="True"/>         <Setter Property="VirtualizingPanel.ScrollUnit" Value="Pixel" />         <Setter Property="BorderBrush" Value="Transparent"/>         <Setter Property="BorderThickness" Value="0"/>         <Setter Property="Margin" Value="0"/>         <Setter Property="HorizontalAlignment" Value="Stretch"/>         <Setter Property="HorizontalContentAlignment" Value="Stretch"/>

I need to scroll up a selected Item to the top of the list. I have looked into the stackoverflow solutions ( 1, 2, 3) , but those did not work as expected in my scenario some how. Thanks with appreciation for a hint/guidance towards a solution in advance.

Community
  • 1
  • 1
MohantaD
  • 43
  • 5
  • 1
    If you'll find an answer, post it there, please :) In my opinion, you cant have both virtualization, different height and proper scroll – cdmnk Jul 08 '16 at 10:11
  • Its scrolling smoothly (either by Pixel / Item) along the virtualization, the question is how to scroll up a random ListViewItem to the top of the list? The below piece of code snippet move an item to the top, but often fails to position the item on top with exact precision. { scrollViewer.ScrollToBottom(); object item = listView.Items[topID]; listView.ScrollIntoView(item); listView.UpdateLayout(); } – MohantaD Jul 08 '16 at 15:33

0 Answers0