private void FocusRow(DataGridRow row) { var cell = row.FindDescendant<DataGridCell>(); if (cell != null) { cell.Focus(); } }
private void SetFocusToSelectedRow() { if (CodeStyleMembers.SelectedIndex >= 0) { DataGridRow row = CodeStyleMembers.ItemContainerGenerator.ContainerFromIndex(CodeStyleMembers.SelectedIndex) as DataGridRow; if (row == null) { CodeStyleMembers.ScrollIntoView(CodeStyleMembers.SelectedItem); row = CodeStyleMembers.ItemContainerGenerator.ContainerFromIndex(CodeStyleMembers.SelectedIndex) as DataGridRow; } if (row != null) { DataGridCell cell = row.FindDescendant <DataGridCell>(); if (cell != null) { cell.Focus(); } } } }
private static void FocusRow(DataGridRow row) { var cell = row.FindDescendant <DataGridCell>(); cell?.Focus(); }