Setting Value of MaskedTextBox

6 posts, 0 answers
  1. Rodney
    Rodney avatar
    40 posts
    Member since:
    Mar 2015

    Posted 05 Feb Link to this post

    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     

  2. Rodney
    Rodney avatar
    40 posts
    Member since:
    Mar 2015

    Posted 05 Feb Link to this post

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

      txtUserName.Text = user.AKOUsername;

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 10 Feb Link to this post

    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
  5. Rodney
    Rodney avatar
    40 posts
    Member since:
    Mar 2015

    Posted 10 Feb in reply to Eyup Link to this post

    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 '#'?
  6. Eyup
    Admin
    Eyup avatar
    3014 posts

    Posted 15 Feb Link to this post

    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
  7. Rodney
    Rodney avatar
    40 posts
    Member since:
    Mar 2015

    Posted 16 Feb in reply to Eyup Link to this post

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

     

    Thank you

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017