RadNumericTextBox rounding...

2 posts, 0 answers
  1. Raymond
    Raymond avatar
    18 posts
    Member since:
    Dec 2012

    Posted 20 Jun 2014 Link to this post

    Hi,

    Is there a way to prevent the user from entering more decimal places than specified in the decimal digits setting? 

    There was another forum post asking something similar about the control automatically adjusting the value when the user enters something out of range.  Setting AllowOutOfRangeAutoCorrect="false" worked great to address the out of range problem.  Is there something along the lines of AllowRoundingAutoCorrect="false"?

    If I set the Type="currency" and NumberFormat-DecimalDigits=2, then I would like the control to display the same sort of validation error as it does for an out of range entry.  Is that possible maybe with javascript?

    And note...the default behavior for any control should NEVER be to just automatically change what the user enters to a valid value.

    Thanks,
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 21 Jun 2014 in reply to Raymond Link to this post

    Hi Raymond,

    I guess you want to cancel the rounding of the entered value. You can set the AllowRounding="false" and KeepNotRoundedValue="true" .

    ASPX:
    <telerik:RadNumericTextBox ID="rntxtCurrency" runat="server" Type="Currency">
       <NumberFormat AllowRounding="false" KeepNotRoundedValue="true" DecimalDigits="2" />
    </telerik:RadNumericTextBox>

    Thanks,
    Princy
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top