How to set focus to a tab after double-clicking a DataGrid?
If you want to set focus to a control on another tab after double-clicking a row in a DataGrid, do the following:
- Create a handler for the DataGrid's MouseDoubleClick event.
- Add code to the handler that sets the event arg's Handled property to true.
- Add code to the handler that calls the WindowManager's SetFocus() method with a reference to the control you want to get focus.
For example:
private void grdOrders_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
e.Handled = true;
mmAppWPF.WindowManager.SetFocus(this.FocusOnNewElement);
}
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 10/24/17
Comment or report problem with topic
