Get all cells in datagrid
问题 Is there a way to get an iteratable collection of all the cells in a DataGrid regardless of whether they are selected or not 回答1: If you mean DataGridCell s you could use Vincent Sibals helper functions to iterate over all rows DataGrid.Items and columns DataGrid.Columns . public DataGridCell GetCell(int row, int column) { DataGridRow rowContainer = GetRow(row); if (rowContainer != null) { DataGridCellsPresenter presenter = GetVisualChild<DataGridCellsPresenter>(rowContainer); // try to get