This project has moved. For the latest updates, please go here.

DecimalUpDown - focus not set

Oct 18, 2016 at 9:58 AM
Edited Oct 18, 2016 at 9:59 AM
Hey there,

I'm using DecimalUpDown control, and when I call the Focus() method, the focus will not be set:
this.MyDecimalUpDown.Focus();
I also tried to set the Property Focusable=True, but there was no change.

Any ideas?
Thanks!
Developer
Oct 18, 2016 at 1:52 PM
Hi,

This is already fixed. The fix is included in v3.1.
To fix it, go in file :
-Xceed.wpf.Toolkit/NumericUpDown/Themes/Aero2.NormalColor.xaml (for Windows8 and up)
-Xceed.wpf.Toolkit/NumericUpDown/Themes/Generic.xaml (for other Windows)
In the style for "NumericUpDown"
a) Replace
<Setter Property="Focusable" Value="False" />
with
<Setter Property="IsTabStop" Value="False" />

b) In the "PART_TextBox"
replace
IsTabStop="{TemplateBinding IsTabStop}"
with
IsTabStop="True"
Marked as answer by mjesner on 10/29/2016 at 7:20 AM
Oct 27, 2016 at 9:49 AM
Hi,

Thank you for the answer. I modfied these 2 files, but focus is still not set when calling Focus() method.
Are there any other Properties I have to set?

Thanks,
Markus
Developer
Oct 27, 2016 at 12:42 PM
Hi,

Which file did you modified ?
Do you reference the dll of the file modified ?
What version of Windows do you have ?
What version of the Toolkit do you have ?

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Oct 27, 2016 at 1:02 PM
Hi,

i downloaded the latest source (https://wpftoolkit.codeplex.com/SourceControl/latest) and modified these files:

Main\Source\ExtendedWPFToolkitSolution\Src\Xceed.Wpf.Toolkit\NumericUpDown\Themes\Aero2.NormalColor.xaml
Main\Source\ExtendedWPFToolkitSolution\Src\Xceed.Wpf.Toolkit\NumericUpDown\Themes\Generic.xaml

I build the wpf-toolkit solution and copied the new dll to my solution. When I have a look to the assembly version => 2.9.0

OS: Windows 10 Pro

Thx.
Developer
Oct 27, 2016 at 2:30 PM
Hi,

I downloaded the latest source (https://wpftoolkit.codeplex.com/SourceControl/latest) and compiled it to have a Xceed.Wpf.Toolkit.dll.
I created a new project with only :
<StackPanel>
    <xctk:DecimalUpDown x:Name="_decimalUpDown"
                        Value="34" />
    <Button Content="TEST"
            Click="Button_Click" />
  </StackPanel>
and
  private void Button_Click( object sender, RoutedEventArgs e )
    {
      _decimalUpDown.Focus();
    }
and this project is referencing the compiled Xceed.Wpf.Toolkit.dll.

Clicking on the button doesn't focus the DecimalUpDown. I can see the bug (which is already fixed in v3.1 by the way).
Then I modified the file
Main\Source\ExtendedWPFToolkitSolution\Src\Xceed.Wpf.Toolkit\NumericUpDown\Themes\Aero2.NormalColor.xaml
and recompiled the Xceed.Wpf.Toolkit.dll.

I went back to my project and clicking on the Button puts the focus on the DecimalUpDown : the Value is highlighted,
Can you try with a new project ?

――――
Get more controls, features, updates and technical support with Xceed Toolkit Plus for WPF
Oct 29, 2016 at 2:20 PM
I created a new project with the old version and my new compiled one. With the old version, it will not work, with the new version it works.
So I think, there is another problem in my project. I will have to look for the problem.

Many thanks, for your help.