示例#1
0
 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();
                    }
                }
            }
        }
示例#3
0
        private static void FocusRow(DataGridRow row)
        {
            var cell = row.FindDescendant <DataGridCell>();

            cell?.Focus();
        }