comboboxdatagridwinui-3winuiwindows-community-toolkit

How to create a 'Searchable / Filter' Combobox in DataGrid WinUI 3


As far as the official docs go, it is all hopeless. I have checked all across web, asked chatGpt but no help. I need something like this, for each cell in DataGrid of WinUI 3.

enter image description here

I have tried using DatagridComboboxColumn, but it is NOT searchable. I tried to use '<combobox>' it KINDOF works as its editable but I am not able to Fill the Combobox Items and Bind with Parent DataGrid.

enter image description here


Solution

  • You can use the built-in AutoSuggestBox for this.

    enter image description here

    If you want the suggestions inside the control itself, I guess you could try the AutoCompleteTextBox (GitHub/NuGet/YouTube).

    Disclaimer: I'm the publisher.

    enter image description here

    <toolkit:AutoCompleteTextBox
        IsSuggestionCaseSensitive="false"
        SuggestionForeground="HotPink"
        SuggestionPrefix="..."
        SuggestionSuffix=" ? [Press Right]"
        SuggestionsSource="{x:Bind Suggestions, Mode=OneWay}" />