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
<UserControl x:Class="XSoftArt.WPFengine.BaseClasses.ListTemplate" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
> |
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
<Menu Name="menu1" Height="54" VerticalAlignment="Top" Background="AliceBlue"> |
<MenuItem Name="MenuItemReports" Background="AliceBlue" Click="MenuItemReports_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/reports.png" /> |
<ContentPresenter Content="Reports" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemExport" Background="AliceBlue" Click="MenuItemExport_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/export32x32xp.png" /> |
<ContentPresenter Content="Export" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemNewRecord" Background="AliceBlue" Click="MenuItemNewRecord_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/new32.png" /> |
<ContentPresenter Content="New record" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemEditRecord" Background="AliceBlue" Click="MenuItemEditRecord_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/edit32.png" /> |
<ContentPresenter Content="Edit record" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemDeleteRecord" Background="AliceBlue" Click="MenuItemDeleteRecord_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/delete32.png" /> |
<ContentPresenter Content="Delete record" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemSettings" Background="AliceBlue" Click="MenuItemSettings_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/settings32.png" /> |
<ContentPresenter Content="Settings" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemRecordHistory" Background="AliceBlue" Click="MenuItemRecordHistory_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/histrory32x32xp.png" /> |
<ContentPresenter Content="Record history" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
<MenuItem Name="MenuItemClose" Background="AliceBlue" Click="MenuItemClose_Click"> |
<MenuItem.Header> |
<StackPanel> |
<Image Width="32" Height="32" Source="/XSoftArt.WPFengine;component/Images/uzdaryti programa.png" /> |
<ContentPresenter Content="Close window" /> |
</StackPanel> |
</MenuItem.Header> |
</MenuItem> |
</Menu> |
<Grid Margin="0,54,0,0" Name="grid1" Height="43" VerticalAlignment="Top" Background="AliceBlue"></Grid> |
<Grid Margin="0,96,0,0" Name="grid2" Height="36" VerticalAlignment="Top" Background="AliceBlue"> |
<Label HorizontalAlignment="Left" Margin="5,7,0,-5" Name="label1" Width="85.223">Record count:</Label> |
<Label HorizontalAlignment="Left" Margin="85,7,0,4" Name="labelRecordCount" Width="57">0</Label> |
<dxe:CheckEdit HorizontalAlignment="Left" Margin="124,7,0,7" Name="checkEdit1" Width="72" xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" Checked="checkEdit1_Checked" Unchecked="checkEdit1_Unchecked">Select all</dxe:CheckEdit> |
<Button Click="buttonDeleteSelected_Click" Background="AliceBlue" BorderThickness="2" HorizontalAlignment="Left" Margin="202,7,0,4" Name="buttonDeleteSelected" Width="89.183" FontSize="9">Delete selected</Button> |
<Label HorizontalAlignment="Right" Margin="0,4,6,4" Name="labelSelectTime" Width="122" FlowDirection="RightToLeft">0</Label> |
<Button HorizontalAlignment="Left" Margin="296.81,7,0,6" Background="AliceBlue" BorderThickness="2" Click="buttonSaveColumnLayout_Click" Name="buttonSaveColumnLayout" Width="125.743">Save column layout</Button> |
</Grid> |
<StackPanel Margin="0,58,149,0" Name="stackPanel1" Width="32" Height="32" HorizontalAlignment="Right" VerticalAlignment="Top"> |
<Button Name="Button_ReloadData" Click="Button_ReloadData_Click" Background="AliceBlue" > |
<Image Source="/XSoftArt.WPFengine;component/Images/reload32.png"></Image> |
</Button> |
</StackPanel> |
<telerik:GridViewDataControl HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="dataGridView1" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Margin="1.425,134,0,0" /> |
</Grid> |
</UserControl> |
<telerik:RadTabControl Margin="0,91,0,-2.896" x:Name="tabControlR" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> |
RadTabItem tabItem = new RadTabItem(); |
ListTemplate lst = new ListTemplate(); |
lst.tabWindow = tabItem; |
tabItem.Content = lst; |
tabItem.Header = "Paieskos langas II"; |
tabItem.Name = "tabPaieskosTestas"; |
tabControlR.Items.Add(tabItem); |
<telerik:RadComboBox x:Name="InsurancePositionComboBox" IsEnabled="{Binding DataContext.IsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" |
Grid.Row="4" Grid.Column="6" |
ItemsSource="{Binding DataContext.InsurancePositionItems,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}" |
DisplayMemberPath="Name" |
SelectedValuePath="StakeholderId" |
SelectedValue="{Binding InsurancePositionId}" |
IsSynchronizedWithCurrentItem="True" Margin="10,0,0,0" Height="25" Width="170"> |
</telerik:RadComboBox> |
<Window.Resources> |
<Style x:Key="ItemContStyle" TargetType="{x:Type ListViewItem}"> |
<Style.Resources> |
<LinearGradientBrush x:Key="Brush1" StartPoint="0.5,0" EndPoint="0.5,1"> |
<GradientStop Offset="0.1" Color="#AA00CC00" /> |
<GradientStop Offset="0.8" Color="#55008800" /> |
</LinearGradientBrush> |
<LinearGradientBrush x:Key="Brush2" StartPoint="0.5,0" EndPoint="0.5,1"> |
<GradientStop Offset="0.1" Color="Orange" /> |
<GradientStop Offset="0.8" Color="OrangeRed" /> |
</LinearGradientBrush> |
</Style.Resources> |
<Style.Triggers> |
<DataTrigger Binding="{Binding Path=Category}" Value="1"> |
<Setter Property="Background" Value="{StaticResource Brush1}" /> |
<Setter Property="Height" Value="25"/> |
</DataTrigger> |
<DataTrigger Binding="{Binding Path=Category}" Value="2"> |
<Setter Property="Background" Value="{StaticResource Brush2}" /> |
<Setter Property="Height" Value="30"/> |
</DataTrigger> |
</Style.Triggers> |
</Style> |
</Window.Resources> |
<ListView x:Name="listView1" ItemContainerStyle="{StaticResource ItemContStyle}"> |
<ListView.View> |
<GridView> |
<GridViewColumn Header="Artist" DisplayMemberBinding="{Binding Path=Artist}" Width="310" /> |
<GridViewColumn Header="Title" DisplayMemberBinding="{Binding Path=Title}" Width="310" /> |
</GridView> |
</ListView.View> |
</ListView> |
selected_id = (
string)((DataRow)((DataRecord)this.radGridView_A1.SelectedRecord).Data)[0];
DataRecord is gone, any sugguestions, Also, don't understrand why telerik posts examples (as of 3 months ago ) of apis that will be obscolete, wtf?