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

RadMaskedEditBox Problems in Q2 2011 version

10 Answers 300 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Eastern
Top achievements
Rank 1
Eastern asked on 15 Jul 2011, 08:39 PM
hi,

today i upgrade my dll's to q2 2011, i have myOwnTextbox that inherited from RadMaskedEditBox , i have some problems with it masktypes.
i have this code :
                if (mType == rTextBoxType.Text)
                {
                    MaskType = MaskType.Standard;
                    Mask = "";
                }
                if (mType == rTextBoxType.Numeric)
                {
                    MaskType = MaskType.Numeric;
                    Mask = "D";
                    RightToLeft = RightToLeft.No;
                }
                if (mType == rTextBoxType.Float)
                {
                    MaskType = MaskType.Numeric;
                    Mask = "F2";
                    RightToLeft = RightToLeft.No;
                }
                if (mType == rTextBoxType.Money)
                {
                    MaskType = MaskType.Numeric;
                    Mask = "c0";
                    RightToLeft = RightToLeft.No;
                }
                if(mType == rTextBoxType.Date)
                {
                    MaskType = MaskType.DateTime;
                    Mask = "d";
                    RightToLeft = RightToLeft.No;
                }
                if(mType == rTextBoxType.Time)
                {
                    MaskType = MaskType.DateTime;
                    Mask = "HH:mm";
                    RightToLeft = RightToLeft.No;
                }

ok, here is its problems:
1- in first case (mType == rTextBoxType.Text) i want to make maskeditbox to a simple textbox, if i put it in standard maskmode it will fill with placeholder character (which was not in previous versions). if i change it to None maskmode, it have problem with assigning text to it's TEXT property. when i assign a text (read from dB) to it's Text property nothing happened !!

2- in secod case (mType == rTextBoxType.Numeric) , the "D" mask does not work any longer for numberic-only text box, i should change it to "n" or "g" , which is strange!

3- Big big problem is in (mType == rTextBoxType.Money) , because i use "Persian (Iran)" cultureinfo in controls , when i put it in this maskmode , nothing happened. i cannot write anything in the textboxt. i think the problem is with cultureinfo.

4- last and new problem! is when something was wrong with the mask, there is red Icon appeared in right side of control. i want to turn it off, i want to disable it. i dont want it to appear anymore.

Would you please help me to solve these problems ?

10 Answers, 1 is accepted

Sort by
0
Jason Parrish
Top achievements
Rank 1
answered on 19 Jul 2011, 03:00 PM
Telerik must have rewritten this control, because I am having various issues with it as well.  I know some will be addressed in the August SP, but I am hoping for an internal build first.
0
Peter
Telerik team
answered on 21 Jul 2011, 01:51 PM
Hi Eastern,

Thank you for the question.

Indeed, we have reimplemented our RadMaskedEditBox control.
Here is a list of the changes made for Q2 2011 release.

Now at the questions:
1) RadMaskedEditBox does not allow you to write into the field if mask is empty. In case that you want to use it as regular text box you should set MaskType to None.

2) When MaskType is Numeric and the mask set is D - it allows you to enter only 1 digit. If you want more digits, you should use D(Number of digits), for example D7 - this will allow users to enter 7 digits.

3) I was able to reproduce this issue with Persian culture and currency mask in our Demo application. We will provide fix for it in our next SP release.

4) This notification icons appear only for Regex mask, IP Mask and Email mask - it means that the value inside the editor does not meet the validation rule.

I hope this helps.

Kind regards,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Bret
Top achievements
Rank 1
answered on 27 Jul 2011, 03:52 PM
I'm wondering if others have experienced this as well, but in the past when using a RadMaskedEditBox (MaskType = Numeric and Mask = c culture = en-US) and the user would press the "." key, it would jump from the dollars to cents. The RadMaskedEditBox doesn't function that way now.

Is there something i'm missing in the new version.

thanks,

Bret
0
Accepted
Jason Parrish
Top achievements
Rank 1
answered on 27 Jul 2011, 03:57 PM
This is a bug I encountered when using a Date mask.  It has been reported to Telerik and I've been told it will be corrected in the SP for August.  In the meantime, I created a work around for it.  Here is my code that I'm sure you can adjust as needed to handle the Dollar and decimal mask.

AddHandler txtMaskedDateBox.KeyPress, AddressOf MaskedDateTextboxFix
 
' ** TELERIK BUG FIX ***
   Private Sub MaskedDateTextboxFix(sender As Object, e As System.Windows.Forms.KeyPressEventArgs)
       Dim num1 As Integer
       Dim textbox As RadTextBoxItem
 
       Try
           If e.KeyChar = "/" Then
               textbox = DirectCast(sender, Telerik.WinControls.UI.RadMaskedEditBoxElement).TextBoxItem
 
               If textbox.SelectionStart = 6 Then
                   textbox.SelectionStart = 0
                   textbox.SelectionLength = 2
               Else
                   num1 = textbox.Text.IndexOf("/", textbox.SelectionStart)
                   If (num1 = -1) Then
                       num1 = textbox.Text.IndexOf("/", 0)
                   End If
 
                   If num1 = 2 Then
                       textbox.SelectionStart = 3
                       textbox.SelectionLength = 2
                   ElseIf num1 = 5 Then
                       textbox.SelectionStart = 6
                       textbox.SelectionLength = 4
                   End If
               End If
           End If
 
       Catch ex As Exception
           ' Do nothing
       End Try
   End Sub
0
Bret
Top achievements
Rank 1
answered on 27 Jul 2011, 04:47 PM
Jason,

Worked like a charm. Thanks.

-Bret

0
Peter
Telerik team
answered on 01 Aug 2011, 11:28 AM
Hello guys,

Jason, thank you for sharing your solution. I have updated your Telerik points for it.

We will address this misbehavior in our SP release at the end of August.

Kind regards,
Peter
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Bret
Top achievements
Rank 1
answered on 12 Aug 2011, 08:51 PM
I know that this post is considered solved, however I have ran another item. I have not used/needed negative currency values with past versions of a RadMaskedEditBox, but in the Q2 2011 release when a users enters the minus sign, "-", the value shows up as it should. However the problem is now the textbox is "frozen"; you can edit any numbers or the sign. Deleting and backspace doesn't do anything, unless you hightlight all text first.

Again is there something I'm missing with this new version?

thanks,
Bret
0
Peter
Telerik team
answered on 15 Aug 2011, 04:44 PM
Hello Bret,

Thank you for writing back.

We are aware of this issue and we will address it in our Service Pack planned for the beginning of September.

Do not hesitate to contact us if you encounter further issues.

Kind regards,
Peter
the Telerik team

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

0
imran
Top achievements
Rank 1
answered on 10 Oct 2011, 10:28 AM
Hi Peter,

Please can you verify me

Telerik.WinControls.UI.RadMaskedEditBoxItem is belongs to Rad winform Q2 2011 SP1??

or any replacement for this control..because i m using this with Telerik Q3 2010 and it perfectly working fine..when i replace rad Q2 2011 SP1 it gives me an error...Please verify me about the matter..

thanks,
Imran khan

0
Peter
Telerik team
answered on 13 Oct 2011, 03:44 PM
Hello Imran,

Thank you for writing.

In Q2 2011 we replaced RadMaskedEditBoxItem with RadMaskedEditBoxElement, so you should change the type in your code. For full list of changes, please read What's new in Q2 2011.

I hope this helps.

Best wishes,
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.

Tags
MaskedEditBox
Asked by
Eastern
Top achievements
Rank 1
Answers by
Jason Parrish
Top achievements
Rank 1
Peter
Telerik team
Bret
Top achievements
Rank 1
imran
Top achievements
Rank 1
Share this question
or