WPF DataGrid Performance

The WPF DataGrid is a fantastic component but it can get pretty slow with a large number of rows or columns.

Try these quick-and-easy changes to improve the performance:

  • Set the following attributes to enable row and column virtualization:
    EnableColumnVirtualization="True"
    EnableRowVirtualization="True"
    

     

  • Set a fixed column width – this reduces the number of layout recalculations that are required when rendering: 
    ColumnWidth="100"
    
About these ads

One thought on “WPF DataGrid Performance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s