wpf datagrid performance

http://stackoverflow.com/questions/1704512/wpf-toolkit-datagrid-scrolling-performance-problems-why

https://social.msdn.microsoft.com/Forums/en-US/f825eb98-9283-4aab-8a7f-1a5fffe26b36/wpf-datagrid-scrollbar-performance-issue?forum=wpf

http://www.codeproject.com/Articles/784529/Solutions-for-WPF-Performance-Issue

http://stackoverflow.com/questions/11379357/wpf-net-4-datagrid-column-performance

http://stackoverflow.com/questions/3022921/wpf-datagrid-performance-concerns

http://stackoverflow.com/questions/697701/wpf-datagrid-performance?noredirect=1

http://social.technet.microsoft.com/wiki/contents/articles/30012.aspx#Rows_x_Columns_Lots_Bad

http://www.c-sharpcorner.com/UploadFile/31514f/optimizing-performace-in-wpf841/

 

https://blogs.msdn.microsoft.com/jgoldb/2008/05/15/whats-new-for-performance-in-wpf-in-net-3-5-sp1/

 

http://stackoverflow.com/questions/13764579/improve-wpf-datagrid-performance

 

https://social.msdn.microsoft.com/Forums/vstudio/en-US/9ea28468-5505-4e28-8220-e216b77ecf28/wpf-datagrid-and-virtualization?forum=wpf

Yes, the WPF DataGrid has built in support for virtualization. By default theVirtualizingStackPanel .IsVirtualizing property is set to true, so by default the virtualization is used on the DataGrid, and you can specify the VirtualizingStackPanel.VirtualizationMode to either Standard or Recycling
By default, a VirtualizingStackPanel creates an item container for each visible item and discards it when it is no longer needed (such as when the item is scrolled out of view). When an ItemsControl contains a many items, the process of creating and discarding item containers can negatively affect performance. When VirtualizationMode is set to Recycling, the VirtualizingStackPanel reuses item containers instead of creating a new one each time.
For example, you can use Recycling mode like this:
<my:DataGrid AutoGenerateColumns="True" ItemsSource="{Binding}" Margin="11,20,8,9" Name="dataGrid1"
VirtualizingStackPanel.VirtualizationMode="Recycling" />

 

DataGrid.EnableColumnVirtualization
        如果启用列虚拟化,则为 true,否则为 false。 注册的默认值为 false。
        https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=ZH-CN&k=k(System.Windows.Controls.DataGrid.EnableColumnVirtualization);k(VS.XamlEditor);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.0)&rd=true
        
DataGrid.EnableRowVirtualization
        如果启用行虚拟化,则为 true,否则为 false。 注册的默认值为 true。
        https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=ZH-CN&k=k(System.Windows.Controls.DataGrid.EnableRowVirtualization);k(VS.XamlEditor);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.0)&rd=true

 

 

这样设置会提高用户体验:

 

        <DataGrid ItemsSource="{Binding UserData}" 
                  EnableColumnVirtualization="True" 
                  EnableRowVirtualization="True"  
                  ScrollViewer.IsDeferredScrollingEnabled ="True"
                  VirtualizingStackPanel.IsVirtualizing="True"
                  VirtualizingStackPanel.VirtualizationMode="Recycling" 
                  AutoGenerateColumns="False">

 

https://files.cnblogs.com/files/CodingArt/DataGrid_Performance.zip

 

 

https://fastwpfgrid.codeplex.com/

posted @ 2016-09-21 10:38  PROS  阅读(1150)  评论(0编辑  收藏  举报