Hi to all,
I'm seeing a demo, I would to goto at last char, but not last char of mask.
I try to explane more clearly, I have example that I attached, when I get focus of control, Carrer appears at first position, I have a value of some characters and thay are less than max length of mask (a20), if a try to press "End", it goto to last char of mask, I would to goto at last inserted char.
Other question, how can I select all, but only inserted value?
SelectionOnFocus gives me several mode when I get focous, it would be nice to have "SelectAllValue" or "CarretToEndValue"
Can I do it or custom it?
7 Answers, 1 is accepted
From your explanation and pictures I suppose that you are using RadMaskedTextInputt with Mask="a20". In this case the behavior you are observing is expected, because the placeholders (not only the mask value) are considered as chars. I could suggest you another approach to get the described behavior. You can use nomask (Mask="") and setting MaxTextLenght to 20 in order to achieve the same restriction for user input:
<
telerik:RadMaskedTextInput
Value
=
"text"
maskedInput:MaskedInputExtensions.MaxTextLength
=
"20"
Mask
=
""
SelectionOnFocus
=
"CaretToEnd"
/>
<
telerik:RadMaskedTextInput
Value
=
"text"
maskedInput:MaskedInputExtensions.MaxTextLength
=
"20"
Mask
=
""
SelectionOnFocus
=
"SelectAll"
/>
This way when the focus is on the maskedinput the caret will be to the end of the vale (when SelectionOnFocus is set to "CaretToEnd") or will select all the value (when SelectionOnFocus is set to "SelectAll").
Please let us know if this works for you.
Regards,
Milena
Telerik by Progress
you can set MaxTextLength property like this:
<
Window
...
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
xmlns:maskedInput
=
"clr-namespace:Telerik.Windows.Controls.MaskedInput;assembly=Telerik.Windows.Controls.Input"
>
<
Window.Resources
>
<
Style
TargetType
=
"telerik:RadMaskedTextInput"
>
<
Setter
Property
=
"maskedInput:MaskedInputExtensions.MaxTextLength"
Value
=
"20"
/>
</
Style
>
</
Window.Resources
>
I hope this information helps.
Regards,
Milena
Telerik by Progress
Ok perfect.
If user insert an underscore character and he comes out from MaskedTextInput, this character disappears, what can I do to resolve this issue?
Ehm... sorry
I'm using these setters
<
Style
x:Key
=
"FieldRadMaskedTextInputStyle"
TargetType
=
"telerik:RadMaskedTextInput"
BasedOn
=
"{StaticResource RadMaskedTextInputStyle}"
>
<
Setter
Property
=
"Margin"
Value
=
"5"
/>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Left"
/>
<
Setter
Property
=
"TextMode"
Value
=
"PlainText"
/>
<
Setter
Property
=
"SpinMode"
Value
=
"None"
/>
<
Setter
Property
=
"SelectionOnFocus"
Value
=
"CaretToBeginning"
/>
<
Setter
Property
=
"UpdateValueEvent"
Value
=
"PropertyChanged"
/>
<
Setter
Property
=
"InputBehavior"
Value
=
"Replace"
/>
<
Setter
Property
=
"EmptyContent"
Value
=
""
/>
<
Setter
Property
=
"Mask"
Value
=
""
/>
<
Setter
Property
=
"SectionsNavigationMode"
Value
=
"None"
/>
<
Setter
Property
=
"IsClearButtonVisible"
Value
=
"False"
/>
Thank you for reporting this issue. I logged it in our Feedback portal where you can track its progress. I have also updated your Telerik points as a small appreciation for your cooperation.
In the meantime, as a workaround you can set Placeholder property to empty string ( <Setter Property="Placeholder" Value=""/>). The issue is caused by the fact that the default value of Placeholder property is underscore. It would be expected behavior if the mask is different then NoMask(Mask=""), but in this case we can confirm that it is a bug.
Please excuse us for any inconvenience caused.
Regards,
Milena
Telerik by Progress