With the new .NET 4.8 framework, I detected problems in the WPF datagrid with comboboxes when scrolling up and down:
Problem with the below image: "The image shows a few empty combo boxes. When the program was loaded, these combo boxes were filled with data but as you scroll up and down in the application, the data disappears"
If I set EnableRowVirtualization to false in the datagrid, the problem can not be detected.
With previous versions of the framework (4.7 or older) I didn't have this problem, either with EnableRowVirtualization configured on true or false.
Why?
<DataGrid Focusable="True" Grid.Column="0" Grid.Row="0" HeadersVisibility="Column" RowHeaderWidth="0" AutoGenerateColumns="False" ItemsSource="{Binding People}" CanUserAddRows="False" CanUserDeleteRows="False" SelectionUnit="FullRow" IsTabStop="True">
<DataGrid.Columns>
<DataGridTextColumn Header="Name" IsReadOnly="True" MinWidth="50" Binding="{Binding Name, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"/>
<DataGridTemplateColumn Header="Age Old">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding Ages, TargetNullValue=''}" SelectedValue="{Binding Age, ValidatesOnDataErrors=True, NotifyOnValidationError=True, UpdateSourceTrigger=LostFocus, TargetNullValue=''}">
</ComboBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
