Masked Edit Box doesn't retain it's mask when assigning a value

4 posts, 0 answers
  1. Bob
    Bob avatar
    41 posts
    Member since:
    Mar 2012

    Posted 04 Jan 2013 Link to this post

    Hi -

    I am using the 2012 Q3 2012.3.1211.40 version of the Masked Edit box.
    I set the mask property to 'c' for (US) currency.  During design time the masked edit box displays properlt $0.00.  It also displays fine when the form initially starts up.  Not only until you assign a value to the text property does the formatting go away.

    I have not experienced this in the previous version of the masked edit box.  I have not made any changes to the source code as well.

    Can you indicate if there was a change made or a bug introduced to the Masked Editbox?

  2. Peter
    Peter avatar
    1148 posts

    Posted 09 Jan 2013 Link to this post

    Hello Bob,

    Thank you for writing.

    We are aware of this issue with RadMaskedEditBox and it is logged in our PITS: 

    To work around it, you can use the following code:
    AddHandler RadMaskedEditBox1
    AddressOf RadMaskedEditBox1_ValueChanged
    Sub RadMaskedEditBox1_ValueChanged(sender As Object, e As EventArgs)
        Dim control As RadMaskedEditBox = DirectCast(sender, RadMaskedEditBox)
        RemoveHandler control.ValueChanged, AddressOf RadMaskedEditBox1_ValueChanged
        control.MaskedEditBoxElement.TextBoxItem.Text = control.MaskedEditBoxElement.Provider.ToString(False, True)
        AddHandler control.ValueChanged, AddressOf RadMaskedEditBox1_ValueChanged
    End Sub

    The issue will be addressed in an internal build.

    I hope this helps.

    Kind regards,
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  3. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 15 Jan 2013 Link to this post

    Further to above, 

    I have defined a standard mask as  ">LLL_LLL_LLL"   that is allowed input is only a Letter converted to uppercase. User input into the control is "AAA-AAA-AAA"

    I have selected the TextMaskFormat property as "ExcludePromptAndLiterals", however when the cell is validated the value property is an empty string. The only way to get something in the value property is by selecting the TextMaskFormat property to "IncludeLiterals" but then the value property is returned as "AAA-AAA-AAA", that is including mask character "-" , and not as "AAAAAAAAA" which is the correct value.

    Any suggestions please?

  4. Peter
    Peter avatar
    1148 posts

    Posted 16 Jan 2013 Link to this post

    Hello George,

    I was able to reproduce the undesired behavior -
    here is the PITS item for it. For the time being, as a workaround I can suggest to clear the value manually from the mask character "-". 

    I updated your Telerik points for this report.

    A bit off-topic, I would kindly ask you to open new threads for questions that are not related to the original topic of the current thread. This will help other user with the same questions find their answers more easily.

    Thank you for your understanding. If you have further questions, do not hesitate to ask.

    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Back to Top