I am using the .NET 4 WPF DataGrid and notice poor vertical scrolling performance when using a large number of columns. Here is what i did to test this:
- Enable Virtualization (VirtualizingStackPanel.IsVirtualizing=”True” VirtualizingStackPanel.VirtualizationMode=”Recycling”)
- Embed the DataGrid in a simple Grid layout and there are no other controls in this window
- The columns have no custom formatting, no images – just simple text
- I am running on a pretty good computer. win7(64-bit) on quad core 3.2gz with 8gb ram and radeon 7800 series card
- Tests with Perforator don’t show anything bad like software rendering, etc
Here are some results:
- 100 rows x 5 cols : Smooth scrolling
- 100,000 rows x 5 cols : Smooth scrolling
- 100 rows x 75 cols : Very poor scroll performance
- 100,000 rows x 75 cols : Completely frozen
What can i do to improve vertical scrolling performance when i have a large number of columns (~75 – 100)?
Thanks
You are missing two very important properties:
Enable both of them and see if that makes a difference. It should help.
I have about 20 or so columns with about 2,500 rows and I haven’t see performance issues, but it 75 columns definitely seems like a lot. You might want to investigate adding a right-click enable/disable columns in the header (similar to excel).