WinUI ComboBox Filtering
ComboBox combines a non-editable text box with a drop-down list so users can quickly select from a curated set of items. The examples below show how to enable incremental filtering and keep the control accessible for touch, keyboard, and screen reader scenarios.
Learn more
Overview
- Use
ItemsSourcebindings for dynamic data so the control updates automatically when your view model changes. - Set
IsEditable="True"to enable inline search while still preventing arbitrary user input from being committed unless it matches a known entry. - Pair with
SelectionChangedevents orSelectedItembindings to react to user choices in view models.
Prerequisites
- WinUI 3 project targeting Windows 10 version 1809 (build 17763) or later
- View model exposing an
ObservableCollection<T>orICollectionView - Localization strategy for the items if you support multiple languages
Add incremental filtering
If a ComboBox contains many items, surface search to keep the dropdown manageable. The pattern below filters items while preserving the original collection.

For large datasets, consider virtualized sources like
CollectionViewSourceor a predictive search service so the filtering logic remains responsive.
Here is the corresponding XAML and code-behind:
<ComboBox SelectionChanged="ComboBox_SelectionChanged" ItemsSource="{x:Bind ViewModel.Items, Mode=OneWay}" SelectedItem="{x:Bind Item, Mode=OneWay}" IsEditable="True" TextSubmitted="ComboBox_TextSubmitted" />private void ComboBox_TextSubmitted(ComboBox sender, ComboBoxTextSubmittedEventArgs args){ if (string.IsNullOrEmpty(args.Text)) return;
var source = (ObservableCollection<string>)sender.ItemsSource; var item = source.FirstOrDefault(s => s.Contains(args.Text, StringComparison.CurrentCultureIgnoreCase));
if (item != null) sender.SelectedItem = item; else sender.SelectedIndex = 0;}Keyboard navigation support
- Handle
TextSubmittedandSelectionChangedtogether so users can commit entries with Enter while maintaining arrow key navigation. - Enable
IsTextSearchEnabled="True"when using simple lists to let WinUI auto-select items as the user types. - When
IsEditable="True", keep the placeholder text descriptive so screen readers announce the expected input.
Best practices
- Validation: Reject values that do not exist in your backing collection to keep data consistent. Provide a
TeachingTipor inline validation message when rejecting input. - Performance: Debounce filter logic or use a timer when your source is remote to avoid spamming network requests.
- Styling: Use
ItemsPresentertemplates to highlight matching substrings when filtering so users can see why an item was returned.
Troubleshooting
- Dropdown closes unexpectedly: Ensure you are not updating the bound collection on the UI thread while the popup is open; batch updates or use
DeferRefresh. - Scroll position resets: Cache the
ScrollViewerinside the ComboBox template and restoreChangeViewafter filter operations. - VoiceOver/Narrator repeats items: Set
AutomationProperties.Namefor custom item templates and keep visual children simple.