This is a migrated thread and some comments may be shown as answers.

NumericUpDown - Able to enter "." when IsInteger="True"

5 Answers 162 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 30 Sep 2013, 05:39 PM
Hello,

I am getting complaints from customers that they are able to enter decimals into a NumericUpDown field defined to accept only integers.

<telerik:RadNumericUpDown IsInteger="True" NumberDecimalDigits="0" />

The user is not able to enter a "." at the end of the string, but they are able to enter it in the middle of the string.

For our particular scenario, this gives the data-entry clerk a difficult time depending on where/what value was mistakenly entered/rounded.

Can we have some sort of property on the control to restrict "." altogether?

5 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 03 Oct 2013, 07:24 AM
Hello,

We are not aware of such issue in the current version of RadNumericUpDown.

Could you give us more details about the culture in which entering a dot in the middle the input causes a decimal value to be parsed in the control. By design if the culture's decimal separator is for example dot entering a comma is allowed but the value is not parsed as decimal. If you want to remove the dot and comma as separators no matter of the current culture of the environment you could set the NumberDecimalSeparator, CurrencyDecimalSeparator and PercentDecimalSeparator to a special symbol that is less likely to be entered. The next code snippet shows the how to set those properties using the loaded event of the control to a '™' symbol:
<telerik:RadNumericUpDown x:Name="theNubmericUpDown" Loaded="theNubmericUpDown_Loaded"
                            IsInteger="True" NumberDecimalDigits="0"/>

and the event:
private void theNubmericUpDown_Loaded(object sender, RoutedEventArgs e)
{
    var numericUpDown = sender as RadNumericUpDown;
 
    numericUpDown.NumberFormatInfo = new NumberFormatInfo();
    numericUpDown.NumberFormatInfo.NumberDecimalSeparator = "™";
    numericUpDown.NumberFormatInfo.CurrencyDecimalSeparator = "™";
    numericUpDown.NumberFormatInfo.PercentDecimalSeparator = "™";
    numericUpDown.NumberFormatInfo.NumberGroupSeparator = "";
    numericUpDown.NumberFormatInfo.CurrencyGroupSeparator = "";
    numericUpDown.NumberFormatInfo.PercentGroupSeparator = "";
}

Hope this is helpful.

Regards,
Vladi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 11 Dec 2013, 04:11 PM
Vladi,
I have the same problem, where I can enter a dot at the beginning or in the middle of the RadNumericUpDown.
The dot is parsed, because if I have 1.1 as a value, tabbing outside the control changes the value to 1.
The NumberDecimalSeparator value is empty. If I set it to *, I can enter this char, but no more a dot.
This really a bug of the control.
I'm currently using the Swiss French culture.
Patrick
0
Konstantina
Telerik team
answered on 13 Dec 2013, 02:35 PM
Hello Patrick,

I tried to reproduce the issue with the latest assemblies, but with no success. I am attaching a short video of my attempt. Could you please review it and let me know if I am missing something.

Regards,
Konstantina
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 15 Dec 2013, 06:39 AM
Konstantina,
you're not able to reproduce the problem, because you're not reading what the problem is. As already said by Rob and myself:
  1. You can not enter a decimal point at the end of the text (it's working correctly and that's your test case).
  2. You can enter a decimal point at the middle or at the beginning of the text (it's not working and you didn't try it).
In your video, you're just trying to enter a decimal point at the end of the string, so it is not accepted, as we already said.
Patrick
0
Accepted
Konstantina
Telerik team
answered on 18 Dec 2013, 01:23 PM
Hi Patrick,

Sorry for the misunderstanding.

I have logged this issue in our feedback portal where you could track its status: http://feedback.telerik.com/Project/143/Feedback/Details/88489-disable-entering-separators-signs-in-numericupdown-when-isinteger-true

Regards,
Konstantina
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
NumericUpDown
Asked by
Rob
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Konstantina
Telerik team
Share this question
or