How to create picker with search ? .NET MAUI framework

zc 51 Reputation points

I can't find how create custom picker with search on .NET MAUI. Where can I find resources about it ?

A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,832 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 34,841 Reputation points Microsoft Vendor


    As a matter of fact, picker is combined by a read-only entry and a pop-up page, therefore, you could implement it by Popup.

    Please refer to the following documentations:

    The following code code snippets could be helpful for you:


       <Entry IsReadOnly="True" >   
               <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/> // Open your Popup Page in TapGestureRecognizer_Tapped method.  

    Layout of Popup Page:

       <StackLayout VerticalOptions="Center"  Padding="10" HorizontalOptions="FillAndExpand" Margin="0,20,0,0" >   
               <SearchBar  x:Name="Searchbar">  
               <ListView  x:Name="ListView"  ItemsSource="{Binding Names}">  
                               <Label Text="{Binding .}"/>  

    Best Regards,

    Alec Liu.

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

  2. dg2k 1,381 Reputation points

    @zc - I think you will find good guidance on Maui SearchBar here.