Reputation: 4714
Lets say I have an AutoCompleteBox with 1000 items.
How do I force the AutoCompleteBox to display the results starting with the first item in the list?
Upvotes: 1
Views: 913
Reputation: 1095
I know this is not much of an answer, but I thought I would share what I discovered, even though it does not solve the problem. I tried all the following in the DropDownOpening
event.
SelectedItem
to null. - Failed.sender
is AutoCompleteBox
and does not contain ScrollViewer
. Second, VerticalOffset
is read-only.AutoCompleteBox
and found that it has a non-public variable called DropDownPopup
that is an instance of System.Windows.Control.PopupHelper
. I could not find it in that library though. It does however, contain a Popup
property with a variable VerticalOffset
. However, I tried to inherit AutoCompleteBox
and was unable to access that variable, so I suspect it must be private.Upvotes: 1
Reputation: 189457
Here is a blind guess based on the default control templates. In DropdownOpening
event:-
var sv = ((FrameworkElement)sender).FindName("ScrollViewer") As ScrollViewer;
if (sv != null)
sv.VerticalOffset = 0;
Upvotes: 1