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

RadMaskedNumericInput focus problem through Mouse

9 Answers 169 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
codeputer
Top achievements
Rank 2
codeputer asked on 13 Mar 2013, 05:22 PM
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,

9 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 18 Mar 2013, 10:11 AM
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.

0
codeputer
Top achievements
Rank 2
answered on 18 Mar 2013, 05:53 PM
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,
0
Petar Mladenov
Telerik team
answered on 21 Mar 2013, 11:27 AM
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.

0
codeputer
Top achievements
Rank 2
answered on 21 Mar 2013, 07:11 PM
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,


0
Petar Mladenov
Telerik team
answered on 25 Mar 2013, 04:49 PM
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.

0
gk
Top achievements
Rank 1
answered on 16 Apr 2013, 10:03 PM
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

0
Petar Mladenov
Telerik team
answered on 19 Apr 2013, 02:27 PM
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.

0
gk
Top achievements
Rank 1
answered on 19 Apr 2013, 04:39 PM
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
0
Petar Mladenov
Telerik team
answered on 24 Apr 2013, 08:44 AM
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.

Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
codeputer
Top achievements
Rank 2
Answers by
Petar Mladenov
Telerik team
codeputer
Top achievements
Rank 2
gk
Top achievements
Rank 1
Share this question
or