I'm trying to make the RadMaskedTextInput behave like the plain textboxes, but taking advantage of built in clear button.
I can not make it behave like a normal text box, especially related to tab order, caret position etc.
(using. v2013.2.729.1050, with theme Expression_Dark)
Here is my code:
<
Grid
x:Name
=
"LayoutRoot"
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"120"
/>
<
ColumnDefinition
Width
=
"20"
/>
<
ColumnDefinition
Width
=
"120"
/>
</
Grid.ColumnDefinitions
>
<
telerik:RadMaskedTextInput
Grid.Row
=
"0"
Grid.Column
=
"0"
HorizontalAlignment
=
"Stretch"
Mask
=
""
InputBehavior
=
"Insert"
SelectionOnFocus
=
"CaretToEnd"
TextMode
=
"PlainText"
SectionsNavigationMode
=
"None"
/>
<
telerik:RadMaskedTextInput
Grid.Row
=
"0"
Grid.Column
=
"2"
HorizontalAlignment
=
"Stretch"
Mask
=
""
InputBehavior
=
"Insert"
SelectionOnFocus
=
"CaretToEnd"
TextMode
=
"PlainText"
SectionsNavigationMode
=
"None"
/>
<
TextBox
Grid.Row
=
"1"
Grid.Column
=
"0"
></
TextBox
>
<
TextBox
Grid.Row
=
"1"
Grid.Column
=
"2"
></
TextBox
>
</
Grid
>
Thank you for your assistance.
Henri
7 Answers, 1 is accepted
We designed the RadMaskedTextInput control to behave like the native TextBox when the Mask property is set to "" (empty string). Can you please elaborate more on your scenario so we can decide if there is an easy approach to achieve all of your requirements.
It will be great if you can send us your current implementation and specify the behavior that you need to be changed to match the native control.
Thank you for your kind cooperation.
Regards,
Pavel R. Pavlov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
If you try the snippet in my post, you can see clearly the difference in behavior between the two textboxes and the two radmaskedtextinputs. Just look at how the caret is positioned, what is selected, how the next control gets the focus.
Best regards,
Henri
Let me try to suggest some possible ways to solve these issues:
1) Position of the caret. In normal textbox the caret goes to the end of the text when the focus is received by tabbing with keyboard. In Q2 2013 SP we created an attached property to solve this in MaskedTextInput:
<telerik:RadMaskedTextInput Grid.Row="0" Grid.Column="2" maskedInput:MaskedInputExtensions.CaretToEndOfTextOnFocus="True"
xmlns:maskedInput="clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
private
void
RadMaskedTextInput_GotFocus(
object
sender, RoutedEventArgs e)
{
var tBox = (sender
as
RadMaskedTextInput).ChildrenOfType<TextBox>().FirstOrDefault();
if
(tBox !=
null
)
{
tBox.Focus();
}
}
4) Currently there are also issues with misplaced symbols when user types quickly. Again, we will try to resolve them for Q3 next month. Regards,
Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Hi Petar,
Thank you for the attached sample, it improves a little but there are still problems.
Unfortunately, when the second RadMaskedTextInput field has the focus,
it is impossible to tab back (shift+tab) into the first RadMaskedTextInput.
This in contrast to the two textboxes on second row.
Also, when you freshly load the page , directly click in the second RadMaskedTextInput, the browser is frozen.
Best regards,
Henri
We are aware of this issue and we will try to fix it for Q3 as well.
Regards,Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Clicking on the X (clear) in the radmaskedtextinput gives an error:
[Window Title]
Visual Studio Just-In-Time Debugger
[Main Instruction]
An unhandled exception ('Unhandled Error in Silverlight Application Object reference not set to an instance of an object. at Telerik.Windows.Controls.RadMaskedTextInput.OnSelectionOnFocus(SelectionOnFocus selectionOnFocus)
at Telerik.Windows.Controls.RadMaskedInputBase.HandleClear()
at Telerik.Windows.Controls.RadMaskedInputBase.<.ctor>b__5(Object p)
at Telerik.Windows.Controls.DelegateCommand.Execute(Object parameter)
at Telerik.Windows.Controls.RadButton.ExecuteCommand()
at Telerik.Windows.Controls.RadButton.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)') occurred in iexplore.exe [6868].
The Just-In-Time debugger was launched without necessary security permissions. To debug this process, the Just-In-Time debugger must be run as an Administrator. Would you like to debug this process?
[V] View process details [Yes, debug iexplore.exe] [No, cancel debugging]
[Expanded Information]
Process Name: C:\Program Files (x86)\Internet Explorer\iexplore.exe
Here is the xaml extract:
<
telerik:RadMaskedTextInput
Grid.Row
=
"0"
Grid.Column
=
"0"
HorizontalAlignment
=
"Stretch"
maskedInput:MaskedInputExtensions.CaretToEndOfTextOnFocus
=
"True"
Mask
=
""
InputBehavior
=
"Insert"
SelectionOnFocus
=
"CaretToEnd"
TextMode
=
"PlainText"
SectionsNavigationMode
=
"None"
/>
Indeed, we have introduced this bug in the mentioned internal build. The fix for it will be included in the next week's internal build. We updated your telerik account points as a thanks for your cooperation.
Regards,Petar Mladenov
Telerik
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>