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

6 posts, 1 answers
  1. Rob
    Rob avatar
    238 posts
    Member since:
    Jan 2009

    Posted 30 Sep 2013 Link to this post

    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?
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 03 Oct 2013 Link to this post

    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 >>
  3. DevCraft banner
  4. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 11 Dec 2013 Link to this post

    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
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 13 Dec 2013 Link to this post

    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 >>
  6. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 15 Dec 2013 Link to this post

    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
  7. Answer
    Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 18 Dec 2013 Link to this post

    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 >>
Back to Top
DevCraft banner