-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
knowledge-base/kb-calculator-recognize-period-comma-decimal.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: Making RadCalculatorPicker Recognize Period or Comma Key as Decimal | ||
description: Learn how to configure the RadCalculatorPicker in WPF to recognize the period or comma key as a decimal separator. | ||
type: how-to | ||
page_title: Configuring RadCalculatorPicker to Accept Period or Comma as Decimal Separator in WPF | ||
slug: kb-calculator-recognize-period-comma-decimal | ||
tags: radcalculator, wpf, keydown, decimal separator | ||
res_type: kb | ||
ticketid: 1642565 | ||
--- | ||
|
||
## Environment | ||
|
||
| Product | Version | | ||
| --- | --- | | ||
| RadCalculator for WPF | Current | | ||
|
||
## Description | ||
|
||
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. | ||
|
||
## Solution | ||
|
||
To make RadCalculatorPicker recognize the period (.) or comma (,) key as the decimal separator, subscribe to the `KeyDown` event and execute the `RadCalculatorCommands.UpdateInput` command. | ||
|
||
#### __[C#]__ | ||
{{region kb-calculator-recognize-period-comma-decimal-0}} | ||
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); | ||
} | ||
} | ||
{{endregion}} |