How to make RadCalculatorPicker recognize period or comma key as decimal

1 Answer 18 Views
Calculator
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
Renier Pretorius asked on 24 Feb 2024, 06:23 PM

Currently the RadCalculatorPicker only recognize the decimal key from a numeric keypad. This is a problem when working on a laptop that does not have a numeric keypad.

Is there an easy and robust way to capture the period keystroke and "convert" it into a decimal key?

Regards

Renier

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 26 Feb 2024, 11:27 AM | edited on 26 Feb 2024, 11:27 AM

Hello Renier,

To achieve your requirement, you can subscribe to the KeyDown event and execute the RadCalculatorCommands.UpdateInput command.

 

private void RadCalculatorPicker_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
    if (e.Key == System.Windows.Input.Key.OemPeriod)
    {
        RadCalculatorCommands.UpdateInput.Execute(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
    }
}

 

I hope this helps.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
commented on 08 Apr 2024, 06:01 PM

Brilliant thanks
Tags
Calculator
Asked by
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or