It seems that the RadMaskedEditBox allways works in replace mode.What I want to do is the following:
On the Enter-Event I select the whole contents of the control. When the user types the first character, the old contents should be replaced by the character he typed. But that doesn't happen. Instead the first character is replaced by the user input. If the former content had 4 characters and the user only types 2 characters the rest of the old input remains in the control.
Sometimes replacement starts on the second character, although the whole content was selected.
Is there a way to replace the old content completely when the user types the first character?
Ralf
5 Answers, 1 is accepted
Thank you for writing.
RadMaskedEditBox always restricts user to type only the allowed characters that fits to the mask pattern and for many masks we cannot clear the initial/pattern value - for example for mask n3 (0.00) we always have two zeros after the decimal sign or for DateTime mask we always have an initial Date that cannot be removed.
Do not hesitate to contact us if you have other questions.
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!
Thank you for the explanation.
So I've to find a workaround, because the EditBox's I'm talking about allow only simple string input. No decimals or something special formatted.
Greetings,
Ralf
Thank you for the feedback.
In this case I would like to suggest using the regular RadTextBox for simple text editing or continue using RadMaskedEditBox, but set the Mask property to None.
You should also subscribe to the Enter event and on this event select whole text, for example:
private
void
radMaskedEditBox1_Enter(
object
sender, EventArgs e)
{
this
.radMaskedEditBox1.SelectAll();
I hope this helps.
All the best,
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!
1. Clear all RMEB fields by setting the RMEB.MaskedEditBoxElement.TextBoxItem to ""
2. Check for Null date and only populate control if Date field value IsNot Null
If you set the ctl.text for a Date mask RMEB to Null, today's date will be filled in. So check for null and don't set it if null.
For
Each
ctl
As
RadMaskedEditBox
In
lstCtls
'loop thru RMEB's on form
ctl.MaskedEditBoxElement.TextBoxItem.Text =
""
'clear textboxItem info first
Dim
sVal
As
String
=
Nothing
Try
sVal = sRow.Item(sFldName)
'look for datarow field based on ctl.name
Catch
e
As
Exception
'catch nulls/nothings
End
Try
If
sVal IsNot
Nothing
Then
'If we set date to null, default date will show up - so don't do it
ctl.Text = sVal
'set text here
ctl.MaskedEditBoxElement.TextBoxItem.ToolTipText = sFldName
'add tooltip
End
If
End
If
End
If
Next
Thank you for sharing your solution with our community.
Your Telerik points have been updated accordingly.
Regards,
Hristo Merdjanov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.