Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Partial number masking

Not answered Partial number masking

Feed from this thread
  • Jason Maronge Master avatar

    Posted on Dec 8, 2011 (permalink)

    Does anyone know how to accomplish partial number masking.  For example, I am trying to mask the display of a SSN and Credit Card but still allowing the user to re-input the whole number.

    I have a

    <telerik:RadMaskedTextBox x:Name="SSN"
    Grid.Row="2"
    Grid.Column="3"
    Width="100"
    Margin="2"
    HorizontalAlignment="Left"
    VerticalAlignment="Center"
    Mask="###-##-####"
    SelectionOnFocus="SelectAll"
    MaskType="Standard"
    Value="{Binding DataContext.SSN,
                         ElementName
    =View,
    Mode=TwoWay,
    NotifyOnValidationError=True,
    ValidatesOnNotifyDataErrors=True}" >
    </
    telerik:RadMaskedTextBox>


    I would like to have a mask when the user views it to be like "***-**-####" but still allow them to put in all 9 numbers.  Is this possible?  It would be the same problem with displaying credit card numbers.  I need to be able to only show the last X number of digits but allow for entry of the whole number.

    I believe I saw an example of the ASP.Net MaskedTextBox with it using a DisplayMask.  I know it may not be supported with the control itself, but is there a way to do it using a Converter?  I have tried but have not succeeded yet.

    Any help is greatly appreciated.

    Jason

    Reply

  • Alex Fidanov Alex Fidanov admin's avatar

    Posted on Dec 13, 2011 (permalink)

    Hi Jason Maronge,

    I am not sure I understand your scenario completely. Do you wish to replace the numbers that are already filled in by asterics and leave the empty spaces (something like a password box)? Or do you want to see something like "123-45-XXXX" where the X-s are the empty positions? If it is the latter, you can change the Placeholder property of the masked control to "X" or "#" and replace the default "_" placeholder.

    Regards,
    Alex Fidanov
    the Telerik team

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

    Reply

  • Jason Maronge Master avatar

    Posted on Mar 20, 2012 (permalink)

    What I need to do is to have the mask show to the users like "***-**-6543" but still have it give me all 9 numbers (795606543). It is a bound control so I need to get the whole SSN on the backend.   If I use the mask "***-**-####" all I get on the backend is the last 4 digits. 

    The user is allowed to type all 9 digits but will only see the last 4.  Using the * stops me from getting the first 5 numbers of the SSN.

    I actually found a way to get this to work without databinding to the control by manipulating 3 variables and the mask in the background, but now I need to have it bound and can't get it to work.

    Hope this makes sense. 

    Reply

  • Tina Stancheva Tina Stancheva admin's avatar

    Posted on Mar 23, 2012 (permalink)

    Hi Jason,

    Unfortunately the MaskedTextBox and MaskedInput controls doesn't support such scenarios. You can instead try creating a custom control using the MS PasswordBox for the first part of the SSN and the MaskedTextInput control for the last four digits.

    Kind regards,
    Tina Stancheva
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > MaskedTextBox > Partial number masking
Related resources for "Partial number masking"

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