Why is WPFToolkit DataGrid so slow when binding?
Posted
by Schneider
on Stack Overflow
See other posts from Stack Overflow
or by Schneider
Published on 2010-03-15T08:32:35Z
Indexed on
2010/03/15
8:39 UTC
Read the original article
Hit count: 636
I have a very simple test application where I have two objects, each with a small collection of items. when I select an object I display its collection in a WPFToolkit DataGrid.
The problem is there is a noticeable delay, such that if you press up/down keys to toggle selection between objects you can see it can't keep up.
Why is the performance so bad?
<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>
The DataContext is populated with some test classes filled with 50 items of random test data.
© Stack Overflow or respective owner