Works well with me:
<StackPanel Orientation="Horizontal"> <ListBox x:Name="_lbx" ItemsSource="{Binding SimpleItems}" Height="100"/> <Button Content="Scroll" Click="DoScroll" /> </StackPanel>
Code for:
in the constructor:
SimpleItems = new List<string>{ "hello", "world", "the world", "is coming", "to an end", "in 2012", "or maybe", "sometime", "in the future"}; DataContext = this;
Then:
public List<string> SimpleItems { get; set; } private void DoScroll(object sender, RoutedEventArgs e) { _lbx.ScrollIntoView(_lbx.Items[_lbx.Items.Count - 1]); }
Could you post the associated XAML and code?
source share