RadMaskedNumericInput focus problem through Mouse

10 posts, 0 answers
  1. codputer
    codputer avatar
    45 posts
    Member since:
    Apr 2007

    Posted 13 Mar 2013 Link to this post

    Hi Telerik,

    We have focus problem for RadMaskedNumericInput control.  We didn't get focus when we are trying to click on RadMaskedNumericInput Control through mouse. Please check images.

    Image 1:- It's RadDatePicker control and when we click on that we have cursor inside that control.
    Image 2:- When we press tab we get the focus on RadMaskedNumericInput control. XAML binding is as below:-

    <telerik:RadMaskedNumericInput Grid.Row="1"
                                                   Name="TxtOwning"
                                                   Grid.Column="1"
                                                   HorizontalAlignment="Left"
                                                   TextMode="PlainText"
                                                   SelectionOnFocus="SelectAll"
                                                   IsClearButtonVisible="False"
                                                   TabIndex="8"
                                                   Value="{Binding Path=BalanceOwing, Mode=TwoWay}"
                                                   Width="175"
                                                   Margin="2"/>

    Image 3:- If we tried to click on RadMaskedNumericInput through mouse at beginning of control, cursor didn't get inside control. Why? Is it bug or we are missing any property to declare in xaml?

    Thanks,
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 18 Mar 2013 Link to this post

    Hi codputer,

     We are not able to reproduce the exact issue you described. Please check out our test project with Q1 2013 dlls attached. When the focus is in the NumericInput after several Tabs pressing, then clicking with mouse puts the caret in the beginning. However, what's the purpose behind this requirement - tabs then mouse ? If you set SelectionOnFocus = CaretToBeginning, then the caret will be on the left when you pres tab and the focus is in the DateTimePicker. Is this suitable for you ?

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. codputer
    codputer avatar
    45 posts
    Member since:
    Apr 2007

    Posted 18 Mar 2013 Link to this post

    Hi Telerik Support,

    Thanks for reply. Yes your solution works perfect. So, I think it's giving us problem because we modified Telerik windows8 theme to our custom theme.

    Going through tab to radmaskednumricinput control works fine. 

    We are trying to achieve that if user go with mouse click on radmaskednumricinput control, it's able to directly start typing.

    In our case, when we try to click on radmaskednumicinput control, it's didn't get cursor inside the control.Please see the image, We try to click an area which indicate in image with Red Circle.

    Here is the code which we changed in telerik.windows.controls.input xaml for windows 8 theme.

    //This is the style type and key
    <Style TargetType="telerikInput:RadMaskedInputBase"  x:Key="RadMaskedInputBaseStyle">

     <!--This is original code as below we change it to get border black..for all telerik-->
    //Old Code
                                            <!--<DoubleAnimation Storyboard.TargetName="FocusedVisual"
                                                             Storyboard.TargetProperty="Opacity"
                                                             To="0.2"
                                                             Duration="0" />-->
    //New Code
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                                                           Storyboard.TargetName="FocusedVisual">
                                                <DiscreteObjectKeyFrame KeyTime="0"
                                                                        Value="Visible" />
                                            </ObjectAnimationUsingKeyFrames>

       <!--Changed for black border-->
    //Old Code
                            <!--<Border x:Name="FocusedVisual"
                                    Opacity="0"
                                    BorderBrush="{telerik:Windows8Resource ResourceKey=MarkerBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}" />-->

    //New Code
                            <Border x:Name="FocusedVisual"
                                    Visibility="Collapsed"
                                    CornerRadius="1"
                                    BorderBrush="{telerik:Windows8Resource ResourceKey=MarkerBrush}"
                                    BorderThickness="1" />

    Let us know how to resolve this issue..

    Thanks,
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 21 Mar 2013 Link to this post

    Hi codputer,

     We prepared a project using an implicit styles in which we combined your MaskedInput definition with the style changes you mentioned. We are not able to reproduce the issue - the focus is accepted well upon clicking with the mouse. Could you please check out our test project and  let us know what can we do in order to reproduce your issues? Thank you in advance for your cooperation.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. codputer
    codputer avatar
    45 posts
    Member since:
    Apr 2007

    Posted 21 Mar 2013 Link to this post

    Hi Telerik Support,

    We check your project with our style which works fine.

    We found problem related to windows8 theme dll reference. Here is description.

    In our case, We have theme project with the use of Windows8 theme xaml files.We modified few xamls of windows8 theme and created Custom theme project as we want for our own required style.

    Now we added our custom theme project dll to our main project as a reference. We also added windows8 theme dll as a reference into our main project. We added windows8 theme dll because we would like to get windows 8 theme to all controls which are not in our custom theme. We set custom theme as application theme in our Main Project App.xaml

    If we remove windows8 theme dll reference from our main project references, RadMaskedNumericInput Control works. But there are some other controls get affect without windows 8 theme dll. Like Scroll bar, tree view check box which then takes Microsoft windows style. We don't want that.

    Please let us know how to resolve this issue.

    Thanks,


  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 25 Mar 2013 Link to this post

    Hello codputer,

    I think the best possible solution in your scenario is to use an implicit style approach.
    You can have Themes folder in your solution containing all Windows8Theme files you need. Your will introduce your custom style changes in Telerik.Windows.Controls.Input.xaml.
    Please let us know if this helps you move in the right direction.

    Kind regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  8. gk
    gk avatar
    24 posts
    Member since:
    Jul 2010

    Posted 16 Apr 2013 Link to this post

    I think I may be having the same issue and it seems to be related in part to the HorizontalContentAlignment of the 2 PreviewInputTextBox controls in the ControlTemplate of the RadMaskedInputBaseStyle Style in the Windows 8 theme file C:\Program Files (x86)\Telerik\RadControls for Silverlight Q1 2013\Themes\Windows8\Themes\Telerik.Windows.Controls.Input.xaml
    [...]
                                    <telerikMaskedInput:PreviewInputTextBox x:Name="EditorSite" TabIndex="{TemplateBinding TabIndex}"
    [...]                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 

    In the 2012Q3 version of this RadMaskedInputBaseStyle->ControlTemplate, the HorizontalContentAlignment was not being set on the PreviewInputTextBox and it usually inherited an value of Stretch whereas now in 2013Q1SP1 it seems to set a value of Right, which propagates to the HorizontalAlignment of the ScrollContentPresenter (from the ContentControl) and makes the hit box a very small rectangle on the right.

    I already had a base style used by all my RadMaskedInputBase controls so I set the control template in the style to a copy of the 2013Q1SP1 template and set HorizontalContentAlignment="Stretch" for the 2 PreviewInputTextBox  in the control template.

    Hope this helps a bit track down the problem....
    GK

  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 Apr 2013 Link to this post

    Hi GK,

     Thank you for your valuable feedback. Indeed, we have changed the Win8 style in the way you described but that was to fix another issue. However, we appreciate this feedback and probably your issues are related to this one. When we work on resolving it,we will have in mind your scenarios and our code change.

    Regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  10. gk
    gk avatar
    24 posts
    Member since:
    Jul 2010

    Posted 19 Apr 2013 Link to this post

    Hi Petar, it seems you're correct, the PITS issue you linked is indeed the one I'm encoutnering; the issue comes up when the masked input controls are in a parent ScrollViewer (w/ containing Grid/StackPanel etc.).
    Question: Is there a better manual fix/workaround I should use rather than the one I mentioned ? (PreviewInputTextBox->HorizontalContentAlignment="Stretch"  in control template)

    Thanks, GK
  11. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 24 Apr 2013 Link to this post

    Hello Gabe,

    Similar issue is discussed here where a user suggests setting IsTabStop to False on the ScrollViewer.
    Hope this might help in your scenario.

    Greetings,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top
DevCraft banner