void Row_Loaded(object sender, RoutedEventArgs e) { var row = (DataGridRow)sender; row.Loaded -= Row_Loaded; DataGridCell cell = GetCell(ParameterGrid, row, 1); TextBox box = cell.FindChild("ValueBox", typeof(TextBox)) as TextBox; //if (cell != null) cell.Focus(); if (box != null) { box.Focus(); } //ParameterGrid.BeginEdit(); }