WPF DataGrid EnableColumnVirtualization=“True” Raises NullReferenceException at DataGridCellsPanel.get_HasCorrectRealizedColumns()
问题 I have a WPF DataGrid with EnableColumnVirtualization="True" . The user control displays but as soon as you scroll or resize you'll receive a NullReferenceException at DataGridCellsPanel.get_HasCorrectRealizedColumns() . Setting ColumnVirtualization="False" corrects the issue. I've tried removing EnableRowVirtualization="True" ... etc thinking that maybe it was due to a combination of properties but I'm able to reproduce the issue with a very simple DataGrid: <DataGrid ItemsSource="{Binding