K
K
kykyryky2016-10-21 14:24:10
.NET
kykyryky, 2016-10-21 14:24:10

How to scroll down in a listbox?

The WPF project, in the ViewModel of the list form, binds to the listbox like this:
ItemsSource="{Binding Path=Items, Mode=OneWay}"
When the list list is updated, the contents of the listbox are updated, everything is fine with this.
From what I googled, you can scroll down the listbox like this:

listbox.TopIndex = listbox.Items.Count - 1;
listbox.SelectedIndex = listbox.Items.Count - 1;

I tried to put this code in the SourceUpdated event handler for the listbox - it didn't help.
Maybe you need another event, or another way? How can I auto-scroll listbox?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikita Zhuravlev, 2016-10-21
@LLIKIPER

stackoverflow 1
stackoverflow 2
May help ;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question