开发者

issue with wpf datagrid cell style when scrolling

开发者 https://www.devze.com 2023-01-02 21:15 出处:网络
I cre开发者_JAVA百科ated a new DataGridCell style for my wpf datagrid (Red Border brush). When I scroll down vertically the selected cells disappear which is ok. When I scroll up I see the selected ce

I cre开发者_JAVA百科ated a new DataGridCell style for my wpf datagrid (Red Border brush). When I scroll down vertically the selected cells disappear which is ok. When I scroll up I see the selected cells but few of them missing their style and it appear in wrong cells.

It look like the data grid remember the selected cells but "forget" their style.

Any idea?

haim


Without any more details I can only guess that artifacts you're experiencing are a result of reusing of virtualized cells. You can test this by disabling column and row virtualization:

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

Also, if this doesn't help did you by any chance override the Equals method of your data items? ItemsControls occasionally glitch when they display several equal items.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号