title: WPF searchable combobox
body: <p>I've got a <code>ComboBox</code> as follows:</p>
  <pre class="lang-xaml prettyprint-override"><code>&lt;ComboBox IsEditable=&quot;True&quot; 
            Width=&quot;200&quot; 
            Height=&quot;25&quot; 
            IsTextSearchEnabled=&quot;False&quot; 
            x:Name=&quot;cb&quot; 
            PreviewTextInput=&quot;Cb_OnPreviewTextInput&quot; 
            ItemsSource=&quot;{Binding ItemList}&quot; 
            Text=&quot;{Binding SearchTextText}&quot;&gt;
      &lt;ComboBox.ItemsPanel&gt;
          &lt;ItemsPanelTemplate&gt;
              &lt;VirtualizingStackPanel /&gt;
          &lt;/ItemsPanelTemplate&gt;
      &lt;/ComboBox.ItemsPanel&gt;
  &lt;/ComboBox&gt;
  </code></pre>
  <p>When <code>Cb_OnPreviewTextInput</code> is called I set <code>IsDropdownOpen = true</code>.
  In the first attempt (after typing the first letter) the first item on the list is selected and I can go up and down using relevant arrows, the caret is still in the <code>TextBox</code>.</p>
  <p>When I keep on typing at that point, I'm not able to navigate up and down (1 item at time) anymore; at this point the whole ScrollViewer gets focus and I can only go to the bottom or to the top, but not 1 by 1. I have to close the popup e.g. by pressing Escape and then reopen by typing 1 character to be able to go up/down again.</p>
  <p>I also noticed that after pressing PageUp the first item gets selected as well, so I tried to mimic that in code, but no luck.</p>
  <p>Does anyone know what to do here to be able to navigate up/down and type without problems?</p>