Setting Focus

6 posts, 0 answers
  1. Richard
    Richard avatar
    11 posts
    Member since:
    Aug 2011

    Posted 19 Nov 2013 Link to this post

    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:

    <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?
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 22 Nov 2013 Link to this post

    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
    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Alex
    Alex avatar
    4 posts
    Member since:
    Jun 2015

    Posted 03 Jun 2015 in reply to Petar Mladenov Link to this post

    Hello!

    However the Bug is still present(

    Is there the possibility to solve this problem? 

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 08 Jun 2015 Link to this post

    Hi Alex,

    This bug is marked as resolved and the foolowing scenarios work on our side:
    - setting FocusedElement in XAML:
    FocusManager.FocusedElement="{Binding ElementName=tBox}"
    - 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
    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
  6. Alex
    Alex avatar
    4 posts
    Member since:
    Jun 2015

    Posted 09 Jun 2015 in reply to Petar Mladenov Link to this post

     

    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

     

  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 11 Jun 2015 Link to this post

    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
    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
Back to Top
UI for WPF is Visual Studio 2017 Ready