Jamie Holloway

I'm having difficulty auto-scrolling ListView content, vertically down, so the last item is in view, when an item is added to an ObservableCollection which is bound to the control. I see other posts with an "EnsureVisible" method, which I cannot locate. So I'm missing something basic here; can anyone help Thanks.

_______

<ListView Name="listView" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True" >
<ListView.View>
<GridView>
<GridViewColumn Header="List Log Entries" Width="250" DisplayMemberBinding ="{Binding Name}"/>
</GridView>
</ListView.View>
</ListView>




Re: Windows Presentation Foundation (WPF) ListView auto-scrolling when adding items to ObservableCollection

Bragi

Whenever you add an item to your observable collection, try doing something like:

Code Block

YourListView.ScrollIntoView(TheNewObject);


Where 'TheNewObject' is the object you just added to the collection (not the container, the actual object).