This is a migrated thread and some comments may be shown as answers.

Setting Value of MaskedTextBox

5 Answers 169 Views
MaskedTextBox
This is a migrated thread and some comments may be shown as answers.
Rodney
Top achievements
Rank 2
Rodney asked on 05 Feb 2016, 07:08 PM

I'm clearly misunderstanding the doc, I have a MaskedTextBox to which I'm trying to assign a value, but all I get is nothing in it and it displays the mask character.

Here's the definition of the text box, pretty simple:

<telerik:RadMaskedTextBox runat="server" ID="txtUserName" ZeroPadNumericRanges="true" Mask="__________" >
</telerik:RadMaskedTextBox     

5 Answers, 1 is accepted

Sort by
0
Rodney
Top achievements
Rank 2
answered on 05 Feb 2016, 07:09 PM

Accidentally it , here's where I'm setting the value:

  txtUserName.Text = user.AKOUsername;

0
Eyup
Telerik team
answered on 10 Feb 2016, 03:27 PM
Hello Rodney,

Please try replacing the underlines with "a" in the Mask:
http://docs.telerik.com/devtools/aspnet-ajax/controls/input/radmaskedtextbox/masks

That should do the trick. Please give it a try and let me know if it works for you.

Regards,
Eyup
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
0
Rodney
Top achievements
Rank 2
answered on 10 Feb 2016, 04:05 PM
Tried that and it did allow me to assign the value to the field, but that, unfortunately, allows alpha characters, and I can only have numerics. Do I need to convert the input to integer or something before assigning it when using the '#'?
0
Eyup
Telerik team
answered on 15 Feb 2016, 09:03 AM
Hi Rodney,

Just replace the "a" symbols with "#" as explained in the table provided in the link in my previous reply.

Regards,
Eyup
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
0
Rodney
Top achievements
Rank 2
answered on 16 Feb 2016, 08:41 PM

This worked, but only after I removed the PromptChar="0". 

 

Thank you

Tags
MaskedTextBox
Asked by
Rodney
Top achievements
Rank 2
Answers by
Rodney
Top achievements
Rank 2
Eyup
Telerik team
Share this question
or