Rhino
Rhino

Reputation: 45

WPF .NET 4 DataGrid Column Performance

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:

What can i do to improve vertical scrolling performance when i have a large number of columns (~75 - 100)?

Thanks

Upvotes: 3

Views: 3944

Answers (1)

kevindaub
kevindaub

Reputation: 3363

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

Upvotes: 5

Related Questions