Hello,
I want to know if is it possible to do that RadNumericUpDown accepts dot AND comma ?
I see this code on the web :
if
(e.KeyChar.Equals(
'.'
) || e.KeyChar.Equals(
','
))
{
e.KeyChar = ((System.Globalization.CultureInfo)System.Globalization.CultureInfo.CurrentCulture).NumberFormat.NumberDecimalSeparator.ToCharArray()[0];
}
With this code, i did it :
private
void
tbOpeSurValeur_KeyDown(
object
sender, KeyEventArgs e)
{
if
(e.Key == Key.Decimal || e.Key == Key.OemComma)
{
e.Key = (Key)((System.Globalization.CultureInfo)System.Globalization.CultureInfo.CurrentCulture).NumberFormat.NumberDecimalSeparator.ToCharArray()[0];
}
}
But, 2 problems :
- This is not 'e.KeyChar' but 'e.Key'
- 'e.Key' is in ReadOnly, I can't change his value..
Can you help me ?
Thank you.
Valentin.