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

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

3 Answers 28 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 2
Bob asked on 04 Jan 2013, 09:45 PM
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?

Thanks
Bob

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 09 Jan 2013, 02:06 PM
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
.ValueChanged, 
AddressOf RadMaskedEditBox1_ValueChanged
.....
Private
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,
Peter
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
George
Top achievements
Rank 1
answered on 15 Jan 2013, 04:57 PM
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?



0
Peter
Telerik team
answered on 16 Jan 2013, 02:15 PM
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.

Greetings,
Peter
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
MaskedEditBox
Asked by
Bob
Top achievements
Rank 2
Answers by
Peter
Telerik team
George
Top achievements
Rank 1
Share this question
or