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

Tab issues

1 Answer 85 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
David Harris
Top achievements
Rank 1
David Harris asked on 13 Feb 2009, 05:21 PM
I'm trying to use the NumericUpDown but have encountered a frustrating issue regarding tabbing. By default when I tab through the screen my NumericUpDown controls get focus twice: first on the control as a whole, then on the internal textbox. I'd like to ignore the focus on the overall control and just go straight into the textbox, so I figured I could handle that in the GotFocus event. Unfortunately, the internal textBox control in a Non-Public member, and when I try to access it via reflection I receive a FieldAccessException. So I currently have no way to force focus into the internal textbox.

Am I missing something obvious? If not, are there thoughts about allowing users to set the control to tab straight into the textbox area? Or, at the very least is there a way to access the textbox from my code so that I can force it manually (by setting IsTabStop to False for the NumericUpDown but IsTabStop to True for the internal textBox)?

1 Answer, 1 is accepted

Sort by
0
Miroslav
Telerik team
answered on 16 Feb 2009, 01:08 PM
Hi David,

I tested this with the 1217 & 1105 versions of the controls and I could not reproduce it. Then I set the IsTabStop property to true and the problem appeared. The IsTabStop property only removes the particular visual item (the control) from the Tab sequence, but not its children.

When I set the IsTabStop property to false (its default value) I see the expected behavior. Currently, the focus will jump directly to the TextBox.

Generally, if you want to get a named visual part of a ControlTemplate, you can use the FindName method on the first visual child of the control. I will only use this when there is definitely no other way to achieve something.

This is the simple xaml that I used to test it:

<StackPanel> 
    <input:RadNumericUpDown  /> 
    <input:RadNumericUpDown  /> 
    <input:RadNumericUpDown  /> 
    <input:RadNumericUpDown  /> 
</StackPanel> 

Please come back to us if I am missing something or the context you use the NumericUpDown in is different.

Regards,
Miroslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
NumericUpDown
Asked by
David Harris
Top achievements
Rank 1
Answers by
Miroslav
Telerik team
Share this question
or