This is a migrated thread and some comments may be shown as answers.

Focus between two RadMaskedTextInput freezes the application

2 Answers 52 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Kristof Van Cauwenberghe
Top achievements
Rank 1
Kristof Van Cauwenberghe asked on 13 Oct 2016, 01:03 PM

Our application uses RadMaskedTextInputs for user data input. When Enter is pressed, we perform field validation and focus the fields that need revising. If however two of these controls are focused one after the other, the application freezes. To test try the following:

Create a WPF with two RadMaskedTextInputs

    <Grid>
        <telerik:RadMaskedTextInput Width="100" Height="20" Margin="200,122,0,167" Name="txt1"></telerik:RadMaskedTextInput>
        <telerik:RadMaskedTextInput Width="100" Height="20" Margin="200,155,0,134" Name="txt2"></telerik:RadMaskedTextInput>
    </Grid>

On txt2 keyup event:

    Private Sub txt2_KeyUp(sender As Object, e As System.Windows.Input.KeyEventArgs) Handles txt2.KeyUp
        If e.Key = Key.Enter Then
            txt1.Focus()
            txt2.Focus() 
        End If
    End Sub

Run the application, type something in txt2 and press enter.

Regards

2 Answers, 1 is accepted

Sort by
0
Accepted
Dinko | Tech Support Engineer
Telerik team
answered on 17 Oct 2016, 11:58 AM
Hello Kristof Van Cauwenberghe,

Thank you for the provided information.

We managed to reproduce the described behaviour on our side. We can confirm that this is a bug and therefore we logged it in our Feedback Portal where you can track its progress and vote for its implementation. By voting, you are increasing its priority. We have also updated your Telerik points for bringing this issue to our attention.

As a workaround, you can use a Dispatcher to focused the controls.
If e.Key = Key.Enter Then
    Dispatcher.BeginInvoke(New Action(Function()
    txtMask1.Focus()
    txtMask2.Focus()
End Function), DispatcherPriority.Loaded)
End If

Give this approach a try and let us know if it works for you.

Regards,
Dinko
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Kristof Van Cauwenberghe
Top achievements
Rank 1
answered on 17 Oct 2016, 01:11 PM
Thanks for the info. I can confirm this workaround works for this particular case, however we would prefer a solution since in our application different pieces of code call the focus, and setting dispatchers on all of them would not be desirable. We will monitor the bug's progress as you suggested.
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Kristof Van Cauwenberghe
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Kristof Van Cauwenberghe
Top achievements
Rank 1
Share this question
or