Home > other >  The WPF Datagrid data showed abnormal after rolling
The WPF Datagrid data showed abnormal after rolling

Time:12-10

WPF Datagrid data are dynamically loaded, and the background has been updated again, ensure that only shows the latest article 25 data update is normal, stop after rolling the scroll bar, each row of data into the same, I have to debug, the background data is right,
The front-end code:
The Grid. The Column="0"
DataGrid2D: Index StartAt="{Binding DataIndexBase}"
DataGrid2D: ItemsSource. ColumnHeadersSource="{Binding MaterialSizeColumnHeaders}"
DataGrid2D: ItemsSource. RowsSource="{Binding MaterialSizeMatrix}"
ColumnWidth="auto"
GridLinesVisibility="All"
HeadersVisibility="All"
IsReadOnly="True"
CanUserSortColumns="False" & gt;
Backend updates code:
While (MaterialSizeMatrix. Count & gt;=25)
MaterialSizeMatrix. RemoveAt (0);
MaterialSizeMatrix. Add (new ObservableCollection (arg. Sizes));
  • Related