Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Editors (TextBox, MaskedEdit, SpinEditor, BrowseEditor, ColorBox) > Exclude mask characters

Not answered Exclude mask characters

Feed from this thread
  • Robert avatar

    Posted on Jun 24, 2009 (permalink)

    Hi All,

    I need to exclude the mask characters from my MaskedEditBox.  Using MS's MaskedTextBox, the code to do this is:

    myMaskedTextBox.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;

    Does anyone know of the equivalent?

    Robert

    Reply

  • Nikolay Nikolay admin's avatar

    Posted on Jun 30, 2009 (permalink)

    Hi Robert,

    We do not have this functionality in our RadMaskedEditBox. However, you can modify the PlaceHolder property which defines the character shown in the edit field instead of the mask characters. By default, the value of this property is "_" and you can set it to a single empty space. We will consider adding the desired functionality in the future releases.

    Best wishes,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

    Reply

  • Robert avatar

    Posted on Jul 27, 2009 (permalink)

    Hi Nikolay,

    I found a solution to my problem.  Ultimately, what I was after was the ability to write just the input value to the database, rather than the value + input mask characters (i.e. for a phone number, store only "1234567890" instead of "(123) 456-7890").

    Originally, I was using the .Text property, but, after switching to the .Value property, I am now receiving the desired results.

    Thanks for your assistance.

    Robert

    Reply

  • Arve Asheim avatar

    Posted on Oct 27, 2011 (permalink)

    Did you actually get this to work?
    I'm binding on the .Value field, and still get the literals using the latest dll-s.
    My mask is for the personal norwegian id, mask = "00-00-00-00000", MaskType = Numeric.
    I only want the digits typed in the .Value field.

    Reply

  • Peter Peter admin's avatar

    Posted on Oct 31, 2011 (permalink)

    Hello Arve,

    We will provide in our next release a property named TextMaskFormat that manages the literals in the Value property.

    For your version Nikolay's workaround is not suitable.

    I would suggest that you wait for the new assemlies or to inherit MaskedEditBox and override the Value property in order to remove literal symbols. Please refer to the code below:

    Public Class MyMaskeditBox
           Inherits RadMaskedEditBox
           Public Property Value() As Object
               Get
                   If Me.Mask.StartsWith("p") Then
                       Return DirectCast(MyBase.Value * 100, Integer)
                   Else
                       Dim stringValue As String = DirectCast(MyBase.Value, String)
                       stringValue = stringValue.Replace("-", "").Replace(" ", "")
                       Return stringValue
                   End If
               End Get
               Set(ByVal value)
                   If Me.Mask.StartsWith("p") Then
                       MyBase.Value = value / 100
                   Else
                       MyBase.Value = value
                   End If
               End Set
           End Property
       End Class

    I hope this helps. All the best,
    Peter
    the Telerik team

    Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

    Reply

  • Arve Asheim avatar

    Posted on Nov 23, 2011 (permalink)

    Did this make the Q3 2011 release?

    Reply

  • Peter Peter admin's avatar

    Posted on Nov 25, 2011 (permalink)

    Hi Arve,

    In Q3 2011 release we provided a property named TextMaskFormat that manages the literals of the Value property.

    All the best,

    Peter
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WinForms > Editors (TextBox, MaskedEdit, SpinEditor, BrowseEditor, ColorBox) > Exclude mask characters
Related resources for "Exclude mask characters"

[ Features | Demos | Documentation | Knowledge Base | Telerik TV | Code Library | Step-by-step Tutorial | Blogs | Self-Paced Trainer ]