Unplanned
Last Updated: 31 Oct 2016 13:28 by ADMIN
ADMIN
Polya
Created on: 31 Oct 2016 13:27
Category: NumericUpDown
Type: Feature Request
0
NumericUpDown: Change the parsing of Key.Decimal to be equal to NumberFormat.NumberDecimalSeparator
Currently we're parsing Key.Decimal the same way we're parsing Key.OemPeriod. 
Our clients want to always type the culture decimal separator when pressing the Numpad separator key (del). 

Currently if the client uses a French culture, which decimal separator is comma - pressing the Numpad separator key does nothing.

Workaround: Handling the RadNumericUpDown.PreviewKeyDown method:
private void RadNumericUpDown_PreviewKeyDown(object sender, KeyEventArgs e)
{
	 var num = sender as RadNumericUpDown;
	 if (e.Key == Key.Decimal || e.Key == Key.OemComma || e.Key == Key.OemPeriod)
	 {
		 var textBox = e.OriginalSource as System.Windows.Controls.TextBox;
		 if (!textBox.Text.Contains(num.NumberDecimalSeparator))
		 {
			 textBox.Text += num.NumberDecimalSeparator;
			 textBox.CaretIndex = textBox.Text.Length;
		 }

		e.Handled = true;
	 }
} 
0 comments