RadMaskedTextInput and CharacterCasing without Mask

2 posts, 0 answers
  1. Lukasz
    Lukasz avatar
    21 posts
    Member since:
    Aug 2014

    Posted 07 Aug 2015 Link to this post

    Hi,

    I am trying to replace TextBox that had CharacterCasing="Upper" with RadMaskedTextInput.

    I do not want to have placeholders, so I cannot use Mask=">a10"

    Is there any other way to change charaters to upper when typing into RadMaskedTextInput?

    Thanks,

    Lukasz

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 11 Aug 2015 Link to this post

    Hi Lukasz,

    There is no out of the box way to set up uppercasing in no-masked RadMaskedTextInput.

    However, you can try the following code if it is applicable at your side:
        <telerik:RadMaskedTextInput Mask=""
                                            ValueChanging="mask_ValueChanging"
                                            Width="300" x:Name="mask"/>
     
    private void mask_ValueChanging(object sender, Telerik.Windows.Controls.MaskedInput.RadMaskedInputValueChangingEventArgs e)
            {
                if (e.NewValue == null)
                    return;
     
                string newValue = e.NewValue.ToString();
                if (newValue.Length > 0)
                {
                    newValue = newValue.ToUpper();
                }
                this.mask.ValueChanging -= this.mask_ValueChanging;
                this.mask.Value = newValue;
                this.mask.ValueChanging += this.mask_ValueChanging;
     
            }

    We hope it will meet your requirements.

    Regards,
    Petar Mladenov
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top