KeyDown Event

Hi, 

I'm building a MAUI application with platform Window and Mac. 

How can my program listen whenever Enter key be down in SfNumbericEntry?

Thank and regards,


3 Replies 1 reply marked as answer

AJ AhamedAliNishad JahirHussain Syncfusion Team February 5, 2024 11:57 AM UTC

Hi Thanh,


Query : How can my program listen whenever Enter key be down in SfNumbericEntry?


We have reviewed your query, and we would like to inform you that SfNumericEntry does not have direct support for the completed event. Instead, you can achieve similar behavior by invoking the completed event of the entry, which is a child of SfNumericEntry. Whenever you press the Enter button in the SfNumericEntry on windows and mac, the Completed event will be triggered, as demonstrated in the code snippet below. Please review the attached sample and let us know the details.


Code Snippet :


Mainpage.xaml.cs  

 

 public partial class MainPage : ContentPage

    {

        public MainPage()

        {

            InitializeComponent();

            (numericEntry.Children[0] as Entry).Completed += MainPage_Completed;

        }

 

        private void MainPage_Completed(object? sender, EventArgs e)

        {

           // here you can write the logic

        }

    }


Regards,

Ahamed Ali Nishad.


Attachment: SfNumericEntry_b6978afa.zip

Marked as answer

TH Thanh Hai Dang April 6, 2024 06:35 AM UTC

Hi AhamedAliNishad ,

Thank for your support, I've resolved my issue. 

Regards,

TH



PR Preethi Rajakandham Syncfusion Team April 8, 2024 04:24 AM UTC

Hi Thanh Hai Dang,

You're welcome. Glad that your issue is resolved. Please let us know if you need further assistance. As always, we are happy to help you out. 

Regards,

Preethi R


Loader.
Up arrow icon