Is there a way to assign a keyboard shortcut to the rad expander so that when pressed, the rad expander will gain focus?
I am referring to both logical and keyboard focus.
For example, if I have 5 rad expanders on my form, and I am at the bottom of the form, I want to press alt+a on the keyboard to jump to the top of the form and bring focus to the address rad expander rather than having to tab several times to get back to the address rad expander.
I have the rad expanders in a child wpf user control which is within a window.
I have tried this syntax and it does not work:
FocusManager.SetFocusedElement(stpApplicantInformation, rxpAddressInformation)
In my xaml I have this:
Note: I have left out much of the xaml code but the stack panel contains 5 rad expanders and a submit button at the bottom.
<UserControl x:Class="AddressInformation"
...
<StackPanel Grid.Row="1"
Margin="0,0,0,0"
Name="stpApplicantInformation"
...
VerticalAlignment="Top" Focusable="True"
KeyboardNavigation.TabNavigation="Cycle" FocusManager.IsFocusScope="True" Visibility="Visible">
...
<StackPanel.CommandBindings>
<CommandBinding Command="Help"
CanExecute="JumpToAddress">
</CommandBinding>
</StackPanel.CommandBindings>
<StackPanel.InputBindings>
<KeyBinding Command="Help" Key="a" Modifiers="Alt"/>
</StackPanel.InputBindings>
...
<!-- this rad expander I want to pressd alt+a and move keyboard and logical focus to it -->
<telerik:RadExpander Header="_Address Information"
Name="rxpAddressInformation"
Width="1000"
Margin="0, 0, 0, 0"
AllowDrop="False"
Height="auto"
TabIndex="1" Focusable="True" Visibility="Visible" >
<UserControl:Address x:Name="AddressInfo" Width="Auto" Height="Auto"></UserControl:Address>
</telerik:RadExpander>
...
...
<Button X:Name="btnSubmit" ... />
</StackPanel>
</UserControl>
What am I doing wrong here?
The JumpToAddress method is fired and is working but using FocusManager.SetFocusedElement(stpApplicantInformation, rxpAddressInformation) does not seem
to move keyboard focus to the address rad expander.
Help!
If I am on the submit button, and press alt+a I want to jump to the address rad expander.
Bill