Declined
Last Updated: 16 Oct 2020 08:54 by ADMIN
Dawid
Created on: 11 Mar 2020 09:46
Category: MaskedInput
Type: Feature Request
2
MaskedInput: Force Uppercase

Add a property to force only allowing uppercase values, without needing to specify a number of characters or have the underline in the control.

 

This is achievable in code, but it seems unnecessary to go to such lengths for each instance where it is needed.

 

private void bankCode_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.txtBankCode.ValueChanging -= this.bankCode_ValueChanging;
            this.txtBankCode.Value = newValue;
            this.txtBankCode.ValueChanging += this.bankCode_ValueChanging;
        }
4 comments
ADMIN
Kalin
Posted on: 16 Oct 2020 08:53

Hi Dawid,

After further discussions with the team about this item, we decided that we will not proceed with an implementation as such feature is not directly related to the main functionality of the control and could be easily achieved with an application logic.

I'm attached a sample project that demonstrates 3 different solutions, however the easiest and the recommended one would be to inherent from RadMaskedTextInput and override the InsertCharNoMask method as shown below:

public class CustomTextInput : RadMaskedTextInput
{
    protected override void InsertCharNoMask(char character)
    {
        base.InsertCharNoMask(char.ToUpper(character));
    }
}

Please let me know if you have any questions or concerns.

Hope this will help you.

Regards,
Kalin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Attached Files:
ADMIN
Dinko | Tech Support Engineer
Posted on: 18 Mar 2020 14:41

Hi Dawid,

Thank you for the additional clarification. You are right that without specifying the number of characters, it will not work. Indeed, this will be a good-to-have improvement to our RadMaskedInput control. I can see that you have already voted for this request. In case this request is of interest to more people and gathers enough votes, so its priority gets high enough, then we will consider it and make it part of our future plans. 

I have updated your Telerik Points for bringing this behavior to our attention.

Regards,
Dinko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Dawid
Posted on: 18 Mar 2020 05:50

Hi

 

As stated in the initial request, we can not have a limit on a specific character count. This also still has the underline in the control. It also does not allow both numbers and text, without specifying the positions of the numeric characters.

For instance having a set of codes as follows:

XA32BC

Z002VRC

KRT7VT

7FDR3

 

Regards

Dawid

ADMIN
Dinko | Tech Support Engineer
Posted on: 17 Mar 2020 15:57

Hi Dawid,

Thank you for the provided solution.

The control provides a way to uppercase '>' or lowercase '<' the entered text. You can use the Mask Modifier Tokens. The Mask property needs to be used in this case. Keep in mind that the '>' and '<' symbols need to be escaped in XAML. Let say for example you have set the 'l' token which means that letters are required and we will need 5. To uppercase, the entered letters check the Mask structure below.

<telerik:RadMaskedTextInput  Mask="&gt;l5" />

I hope this information is helpful.

Regards,


Dinko
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.