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
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!
Is there something i'm missing in the new version.
thanks,
Bret
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
Worked like a charm. Thanks.
-Bret
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.
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!
Again is there something I'm missing with this new version?
thanks,
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.
Peter
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
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
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.