RadNumericTextBox cannot cope with int64 maxvalue

4 posts, 0 answers
  1. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 05 Sep 2013 Link to this post

    How can I set up a RadNumericTextBox to cope with the full range of an int64?

    I currently have:
    <telerik:RadNumericTextBox ID="RadNumericTextBox1" DataType="System.Int64"
                runat="server" Culture="en-US" EnableSingleInputRendering="True"
                LabelWidth="64px" MaxValue="9223372036854775807" MinValue="0">
    <NumberFormat ZeroPattern="n" AllowRounding="False" DecimalDigits="0" GroupSeparator=""></NumberFormat>
            </telerik:RadNumericTextBox>

    According to MSDN,the maxvalue of int64 is 9223372036854775807.

    It appears to be impossible to configure a RadNumericTextBox to accept and return this number.

    If you set DataType="System.Int64" and enter 9223372036854775807, the control changes it to 9223372036854776000.

    If you try and read back 9223372036854776000 then .DbValue throws an overflowexception, and .Text returns "9.22337203685478E+18".

    Does RadNumericTextBox support int64 or not?

    Thanks.

  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 10 Sep 2013 Link to this post

    Hi Craig,

    RadNumericTextBox works internally with double both Client and Server side, because in JavaScript there is no int64 type.

    From Q2 2013 you can use RadMaskedTextBox with Int64(long) mask to populate such values. See more in this help topic:
    http://www.telerik.com/help/aspnet-ajax/input-maskedtextbox-masks.html

    The MaskedTextBox works with string internally, and the parsing of long is implemented in the control itself, without relying on the JavaScript primary float type.

    Regards,
    Vasil
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Craig Wallace
    Craig Wallace avatar
    118 posts
    Member since:
    Jan 2005

    Posted 23 Oct 2013 Link to this post

    Hi Vasil,

    Can you provide a code sample illustrating how this situation should work with RadControls?

    I.e., A user can enter 9223372036854775807 but cannot enter 9223372036854775808.

    Thanks,

    Craig

  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 23 Oct 2013 Link to this post

    Hi Craig,

    Here is an example:
    <telerik:RadMaskedTextBox runat="server" ID="RadMaskedTextBox1" Width="200px"
        Mask="<0...9223372036854775807>">
    </telerik:RadMaskedTextBox>


    Regards,
    Vasil
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top