Wpf DataGrid - Unable to select cells programmatically
问题 I need to select all the cells of a column which header was clicked , i took this from the following post : Selecting all Cells in Column when a certain column is clicked i wan't to select all it's respected cells. cs : private void OnColumnsClicked(object sender, RoutedEventArgs e) { var columnHeader = (DataGridColumnHeader)e.OriginalSource; this.AssociatedObject.SelectedCells.Clear(); for (int i = 0; i < this.AssociatedObject.Items.Count; i++) { var cellInfo = new DataGridCellInfo(this