This works, too:
<Window FocusManager.FocusedElement="{Binding ElementName=SomeElement}">
<DataGrid x:Name="SomeElement">
...
</DataGrid>
</Window>
More Related Contents:
- KeyBinding in UserControl doesn’t work when TextBox has the focus
- Set the focus on a textbox in xaml wpf
- WPF: How to programmatically remove focus from a TextBox
- WPF: Remove dotted border around focused item in styled listbox
- How to Extract Default Control Template In Visual Studio?
- How to bind multiple values to a single WPF TextBlock?
- What is so special about Generic.xaml?
- How to define TextBox input restrictions?
- Best way to use a vector image in WPF?
- DependencyProperty getter/setter not being called
- How can I paginate a WPF DataGrid?
- Finding specific pixel colors of a BitmapImage
- What is the difference between Width and ActualWidth in WPF?
- WPF calling commands via events
- WPF Datagrid set selected row
- What’s the difference between Dependency Property SetValue() & SetCurrentValue()
- Keyboard events in a WPF MVVM application?
- What does it mean to “Capture the mouse” in WPF?
- WPF: Display a bool value as “Yes” / “No”
- Good NumericUpDown equivalent in WPF? [closed]
- How can I determine if my TextBlock text is being trimmed?
- Clicking HyperLinks in a RichTextBox without holding down CTRL – WPF
- When Clearing an ObservableCollection, There are No Items in e.OldItems
- Hide WPF elements in Visual Studio designer
- TabControl with Add New Tab Button (+)
- How to start the WPF window from console programmatically?
- App.xaml file does not get parsed if my app does not set a StartupUri?
- How to access a control from a ContextMenu menuitem via the visual tree?
- How to get TreeViewItem from HierarchicalDataTemplate item?
- How can I tell my DataTemplate to bind to a property in the PARENT ViewModel?