Skip to content

Commit ee93b85

Browse files
Merge pull request #2942 from telerik/new-kb-kb-calculator-recognize-period-comma-decimal-3900bed54a654c7081e81e58cb8bc166
Added new kb article kb-calculator-recognize-period-comma-decimal
2 parents 8aed574 + 42578a3 commit ee93b85

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Making RadCalculatorPicker Recognize Period or Comma Key as Decimal
3+
description: Learn how to configure the RadCalculatorPicker in WPF to recognize the period or comma key as a decimal separator.
4+
type: how-to
5+
page_title: Configuring RadCalculatorPicker to Accept Period or Comma as Decimal Separator in WPF
6+
slug: kb-calculator-recognize-period-comma-decimal
7+
tags: radcalculator, wpf, keydown, decimal separator
8+
res_type: kb
9+
ticketid: 1642565
10+
---
11+
12+
## Environment
13+
14+
| Product | Version |
15+
| --- | --- |
16+
| RadCalculator for WPF | Current |
17+
18+
## Description
19+
20+
When using the RadCalculatorPicker on a device without a numeric keypad, the decimal key does not work as expected. This article demonstrates how to make RadCalculatorPicker recognize the period or comma key as a decimal separator.
21+
22+
## Solution
23+
24+
To make RadCalculatorPicker recognize the period (.) or comma (,) key as the decimal separator, subscribe to the `KeyDown` event and execute the `RadCalculatorCommands.UpdateInput` command.
25+
26+
#### __[C#]__
27+
{{region kb-calculator-recognize-period-comma-decimal-0}}
28+
private void RadCalculatorPicker_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
29+
{
30+
if (e.Key == System.Windows.Input.Key.OemPeriod)
31+
{
32+
RadCalculatorCommands.UpdateInput.Execute(CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator);
33+
}
34+
}
35+
{{endregion}}

0 commit comments

Comments
 (0)