Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Numeric format

Not answered Numeric format

Feed from this thread
  • chou avatar

    Posted on Apr 12, 2011 (permalink)

    I want to use the RadMaskedTextBox to input number.
    Format is like this 999,999.
    When i input number the comma can be filled automatic.
    I don't want display comma  when i don't input number.
    please help.
    thanks.

    Reply

  • Kiril Stanoev Kiril Stanoev avatar

    Posted on Apr 12, 2011 (permalink)

    Hi chou,

    I'd like to suggest you use our new RadMaskedNumericInput control which is part of the RadMaskedInput suite. For your particular case, you will have to add a little bit of code-behind to achieve your exact specifications.

    <telerik:RadMaskedNumericInput Mask="#6" FormatString="{}{0:######}"
            ValueChanged="RadMaskedNumericInput_ValueChanged"
            AutoFillNumberGroupSeparators="False" Placeholder=" "
            HorizontalAlignment="Stretch" />

    private void RadMaskedNumericInput_ValueChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
    {
        RadMaskedNumericInput input = (sender as RadMaskedNumericInput);
        int selStart = input.SelectionStart;
        if (input.Value > 999)
        {
            input.AutoFillNumberGroupSeparators = true;
        }
        else
        {
            input.AutoFillNumberGroupSeparators = false;
        }
        input.SelectionStart = selStart + 1;
    }

    The result of the above can be seen here. Let me know if this helps.

    Kind regards,
    Kiril Stanoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

  • Alan avatar

    Posted on Oct 19, 2011 (permalink)

    I am trying use the RadNumericInput control and need to allow the users to enter signed decimal. Where they can add the negative sign to the decimal number I can not seem to get the mask and formatstring to work properly, Any help on this would be great

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Oct 24, 2011 (permalink)

    Hello Alan,

     We hope that the latest internal builds will work for you as described in this thread.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Numeric format
Related resources for "Numeric format"

Silverlight MaskedTextBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]