2
我有一个非常简单的测试应用程序,我有两个对象,每个对象都有一个小的项目集合。当我选择一个对象时,我在WPFToolkit DataGrid中显示它的集合。为什么WPFToolkit DataGrid在绑定时如此缓慢?
问题是有一个明显的延迟,如果按上/下键切换对象之间的选择,你可以看到它跟不上。
为什么表现如此糟糕?
<Window x:Class="SlowGridBinding.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
Title="MainWindow" Height="350" Width="525">
<StackPanel>
<ListBox ItemsSource="{Binding Shops}" DisplayMemberPath="Name" IsSynchronizedWithCurrentItem="True"/>
<Controls:DataGrid ItemsSource="{Binding Shops/Vegetables}" AutoGenerateColumns="True"/>
</StackPanel>
在DataContext填充有一些填充有50项随机测试数据的测试类。
可能重复 http://stackoverflow.com/questions/1069025/wpf-toolkit-datagrid-performance http://stackoverflow.com/questions/1704512/wpf-toolkit-datagrid-scrolling-performance-problems -为什么 – jonny 2010-03-15 08:51:27