Thursday, August 14, 2008

A new WPF DataGrid in a CTP release

When I reviewed some 3rd party WPF components out there I noticed the fact most of them showcased a datagrid claimed to perform better than the default grid.

After reading Tamir's post about the new WPF DataGrid CTP I have to wonder if this is about the change, as there seem to be serious performance improvements in the new grid:

WPF’s goals for controls in 3.5 SP1 focused on supporting building DataGrid in our next release and improving the performance of our controls overall. One of our top priorities is to develop a high performance, full-featured DataGrid to support demanding LOB and ISV scenarios, and many of our improvements in controls focused in this area. We also wanted to make changes to our infrastructure to improve performance of all of our controls and achieve faster application start-up times

One specific feature that looks promising is deferred scrolling:

Deferred scrolling is a perceived performance improvement for ItemsControls such as ListBox. The default behavior of ScrollViewer in WPF is "live" scrolling, where the user is able to see the contents of the scroll viewer move while dragging the thumb of a scroll bar. This can be problematic for controls such as ListView and DataGrid, which often have complex item templates and use virtualization. In these cases, the amount of processing required to refresh the view with new items consumes too large an amount of time for the UI to appear snappy. To the end-user, the UI could feel sluggish and non-responsive. Deferred ("non-live") scrolling is an alternative scrolling behavior where the contents of the scroll viewer remain static until the user releases the mouse button (similar to the behavior of the Outlook 2007 Inbox). In the absence of other performance improvements, having non-live (deferred) scrolling could be beneficial for improving the end-user’s perception of scrolling performance.
You can find additional information on using the datagrid in Vincent Sibal's blog.

No comments: