for (int i = 0; i < dataGrid.Items.Count; i++) { DataGridRow row = (DataGridRow)dataGrid.ItemContainerGenerator.ContainerFromIndex(i); TextBlock cellContent = dataGrid.Columns[0].GetCellContent(row) as TextBlock; if (cellContent != null && cellContent.Text.Equals(textBox1.Text)) { object item = dataGrid.Items[i]; dataGrid.SelectedItem = item; dataGrid.ScrollIntoView(item); row.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next)); break; } }
SelectedIndex
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)