In wpf the autocompletebox scroll bar does not move with the Up / Down key. When I select an item with Up / Down key, the scroll bar does not move with the selected item.
In wpf autocompletebox scroll bar does not move with up down key
1.2k Views Asked by user1039793 At
2
There are 2 best solutions below
0

See my answer at https://stackoverflow.com/a/24241299/603268
Attach a SelectionChanged event and then, inside the handler:
private void AutoCompleteBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
AutoCompleteBox box = (AutoCompleteBox)sender;
ListBox innerListBox = (ListBox) box.Template.FindName("Selector", box);
innerListBox.ScrollIntoView(innerListBox.SelectedItem);
}
This is my version of autocomplete, hope it helps :-
Download the WPF Toolkit and install it. Add a reference to System.Windows.Controls.Input.Toolkit in your project.
Add following code to your Page or window tag
Use it like following where you want to put the code