I'm trying to set a RadMaskedTextInput as the initially focused element by using FocusManager.FocusedElement. However this is proving problematic as it is focusing the element but not putting focus into the editable area (If I press tab I get the result that I want). This issue can be reproduced with the following code:
It works fine for the TextBox, but not for the RadMaskedTextInput. I'd resort to sending a tab key press, but SendKeys isn't available in WPF and I don't want to PInvoking.
Any suggestions to get this working?
<
StackPanel
FocusManager.FocusedElement
=
"{Binding ElementName=RadMaskedTextInput}"
>
<
TextBox
x:Name
=
"NonTelerikTextBox"
></
TextBox
>
<
telerik:RadMaskedTextInput
x:Name
=
"RadMaskedTextInput"
/>
</
StackPanel
>
It works fine for the TextBox, but not for the RadMaskedTextInput. I'd resort to sending a tab key press, but SendKeys isn't available in WPF and I don't want to PInvoking.
Any suggestions to get this working?
7 Answers, 1 is accepted
0
Hello Richard,
You have hit a known issue in our MaskedInput control. It will be fixed in the next week's internal build well as in the Service Pack coming in a few weeks. Please excuse us for the inconvenience caused.
Regards,
Petar Mladenov
Telerik
You have hit a known issue in our MaskedInput control. It will be fixed in the next week's internal build well as in the Service Pack coming in a few weeks. Please excuse us for the inconvenience caused.
Regards,
Petar Mladenov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
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 >>
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 >>
0
Alex
Top achievements
Rank 1
answered on 03 Jun 2015, 11:33 AM
Hello!
However the Bug is still present(
Is there the possibility to solve this problem?
0
Hi Alex,
This bug is marked as resolved and the foolowing scenarios work on our side:
- setting FocusedElement in XAML:
- invoking Focus() on MaskedInput control in code behind.
Could you please let us know your exact scenario, what is the unexpected behavior and which version of our product you use ? Thank you in advance for your cooperation.
Regards,
Petar Mladenov
Telerik
This bug is marked as resolved and the foolowing scenarios work on our side:
- setting FocusedElement in XAML:
FocusManager.FocusedElement="{Binding ElementName=tBox}"
Could you please let us know your exact scenario, what is the unexpected behavior and which version of our product you use ? Thank you in advance for your cooperation.
Regards,
Petar Mladenov
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
Alex
Top achievements
Rank 1
answered on 09 Jun 2015, 06:25 AM
Version of product is 2015.1.225.40
The scenario is following:
<
DataTemplate
x:Key
=
"PhoneDataTemplate"
DataType
=
"classes:CardFieldPhone"
>
<
telerik:RadMaskedTextInput
Width
=
"100"
x:Name
=
"PhoneMaskedNumber"
InputBehavior
=
"Replace"
UpdateValueEvent
=
"LostFocus"
IsClearButtonVisible
=
"False"
HorizontalAlignment
=
"Stretch"
Margin
=
"0,0,4,0"
Value
=
"{Binding PhoneMaskedNumber, UpdateSourceTrigger=PropertyChanged}"
Mask
=
"{Binding PhoneMask}"
>
<
telerik:RadMaskedTextInput.InputBindings
>
<
KeyBinding
Key
=
"Enter"
Command
=
"{x:Static msc:ApplicationCommandLibrary.ConfirmValueChange}"
CommandParameter
=
"{Binding}"
/>
</
telerik:RadMaskedTextInput.InputBindings
>
</
telerik:RadMaskedTextInput
>
<
DataTemplate.Triggers
>
<
DataTrigger
Binding
=
"{Binding Path=IsSelected}"
Value
=
"True"
>
<
Setter
TargetName
=
"PhoneMaskedNumber"
Property
=
"FocusManager.FocusedElement"
Value
=
"{Binding ElementName=PhoneMaskedNumber}"
/>
</
DataTrigger
>
</
DataTemplate.Triggers
>
</
DataTemplate
>
Thank You!
Regards,
Alex
0
Hi Alex,
Where is this template used - is it in GridView , or other control Templates ? Can you please replace the MaskedInput with TextBox and check whether the focus is successfully placed inside the TextBox ?
Thank you in advance for your cooperation.
Regards,
Petar Mladenov
Telerik
Where is this template used - is it in GridView , or other control Templates ? Can you please replace the MaskedInput with TextBox and check whether the focus is successfully placed inside the TextBox ?
Thank you in advance for your cooperation.
Regards,
Petar Mladenov
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
malcolm
Top achievements
Rank 1
answered on 15 Dec 2016, 10:07 AM
This problem still seems to exist. Version 2016.3.1024.
<
telerik:RadMaskedNumericInput
x:Name
=
"TextBoxLottoStraightBet"
Grid.Column
=
"2"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Center"
Mask
=
"c5.2"
TextMode
=
"PlainText"
SelectionOnFocus
=
"SelectAll"
AcceptsReturn
=
"False"
Margin
=
"5,0,5,0"
AutoFillZeros
=
"False"
Focusable
=
"True"
IsTabStop
=
"False"
KeyboardNavigation.IsTabStop
=
"True"
KeyboardNavigation.TabIndex
=
"1"
maskedInput:MaskedInputExtensions.IsEditorTabStop
=
"True"
maskedInput:MaskedInputExtensions.Minimum
=
"0"
maskedInput:MaskedInputExtensions.Maximum
=
"9999.99"
IsClearButtonVisible
=
"False"
AutoFillNumberGroupSeparators
=
"False"
GotFocus
=
"TextBoxLottoStraightBet_GotFocus"
KeyDown
=
"TextBoxLottoStraightBet_KeyDown"
/>
Setting focus in code
TextBoxLottoStraightBet.Focus();
This sets the focus to the control but not the editor, it requires the user to press Enter in order to change the content. If this is by design, how can I cause the Focus() method to send the user directly to the editable control?
0
Hello Malcolm,
KeyboardNavigation.IsTabStop should be synced with IsTabStop and they both need to be False. This way the focus will move tot he Editor TextBox successfully:
Regards,
Petar Mladenov
Telerik by Progress
KeyboardNavigation.IsTabStop should be synced with IsTabStop and they both need to be False. This way the focus will move tot he Editor TextBox successfully:
KeyboardNavigation.IsTabStop="False"
Regards,
Petar Mladenov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which
deliver the business app essential building blocks - a grid component,
data visualization (charts) and form elements.