DataGrid scrolling shuffles cells between rows

Feb 4, 2010 at 4:12 PM


I am using customized DataGrid to visualise some specialized data. To do this I've created a WPF template (with converters and several data bindings to underlying row item) applied to some datagrid cells on predefined datagrid columns.

The problem occurs when I use virtualization for scrolling (it is essential for me due to large amount of data). Scrolling for normal, simple datagrid cells works properly, but for my specialised, templated cells seems to "shuffle" them between rows (ex. scrolling up and down several times makes such a mess)

It looks like UI (rows) refreshing occurs to late (after VirtualizingStackPanel scrolls elements) in comparison to simple elements. Is there any method for accesing particular cell and refreshing its UI content? (I have got access to DataGridRows collection and DataGrid object from MouseWheelUp and MouseWheelDown event handler in VirtualizingStackPanel)

Feb 5, 2010 at 9:36 AM

Problem fixed:

When DataGrid EnableRowVirtualization property is set to True problem occurs - changing it to false makes everything ok.

I think I had this problem because of using templated rows container with elements with enabled virtualization - maybe it was generating some conflicts with biult-in DataGrid virtualization?


Feb 6, 2010 at 1:48 PM

It seems it's not fixed.

Can anyone please help me with this case?? Changing EnableRowVirtualization to false with virtualization enabled in elements from templated DataGrid doesn't work - it freezes DataGrid for about 15 seconds for rendering graphics.

As described here: refresh call leads to an asychronous call to UpdateLayout operation - is there a way for overriding it? Let's say updating DataGrid vritualized panel after each cell has been refreshed?

Thanks for any help!!