Problem with wpf datagrid cell style while scrolling

I created a new DataGridCell style for my wpf datagrid (Red border brush). When I scroll down vertically, the selected cells disappear, which is normal. When I scroll up, I see the selected cells, but few of them skip their style and appear in the wrong cells.

It seems that the data grid remembers the selected cells, but "forgets" their style.

Any idea?

Haim

+6
c # wpf datagrid
source share
1 answer

Without any details, I can only guess that the artifacts you are experiencing are the result of reusing virtualized cells. You can verify this by disabling column and row virtualization:

<DataGrid EnableRowVirtualization="False" EnableColumnVirtualization="False" ... 

Also, if that doesn't help, will you accidentally replace the Equals method of your data items? ItemsControls sometimes crash when multiple identical items are displayed.

+8
source share

All Articles