Picker.Focus() Not working in Windows - MAUI

Vaibhav Methuku 120 Reputation points
2025-03-13T07:31:30.59+00:00

Hello,

I had a layout, Basically on tapping on that layout, I want to focus my picker. Unfortunately. picker.focus() is not working.

Thanks.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
4,005 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 49,301 Reputation points Microsoft External Staff
    2025-03-14T02:58:09.0266667+00:00

    Hello,

    In WinUI3 platform, the drop-down box of Combox control corresponding to Picker is not related to Focus(). You can refer to the following code to implement this function in Windows platform in a native way.

    #if WINDOWS
            var p = picker.Handler.PlatformView as ComboBox;
            p.IsDropDownOpen = true;
    #endif
    

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.