3
votes

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:

  1. Enable Virtualization (VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Recycling")
  2. Embed the DataGrid in a simple Grid layout and there are no other controls in this window
  3. The columns have no custom formatting, no images - just simple text
  4. I am running on a pretty good computer. win7(64-bit) on quad core 3.2gz with 8gb ram and radeon 7800 series card
  5. 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

1
Does 75 columns make sense, even it it worked flawlessly? I suggest using only important columns by default and showing an alphabetically sorted list of optional columns as checkboxes to the side of a grid which can be made visible on request by user. - doblak

1 Answers

5
votes

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).