title: WPF Toolkit DataGrid scrolling performance problems - why?
body: <p>I have a performance problem with the (WPF Toolkit) DataGrid. It contains about 1.000 rows (only eight columns) and scrolling is horribly slow and laggy. Also the initial load of the Window containing the DataGrid takes 5-10 seconds.</p>
  
  <p>I did some research (using google and StackOverflow) but couldn't find anything besides the advice to turn on UI virtualization. But even after explictly enabling that scrolling continues to be awfully slow. </p>
  
  <p>My DataGrid is bound to an ICollectionView / CollectionViewSource. It's is defined in XAML like this (the columns are explicitly defined, not auto generated):</p>
  
  <pre><code>    &lt;tk:DataGrid x:Name="dataGrid" 
                   ItemsSource="{Binding Path=Bookings}" 
                   AutoGenerateColumns="False" 
                   Grid.Row="1" 
                   EnableRowVirtualization="True" 
                   EnableColumnVirtualization="True"
                   VirtualizingStackPanel.IsVirtualizing="True"
                   VirtualizingStackPanel.VirtualizationMode="Recycling"&gt;
              ... 
      &lt;/tk:DataGrid&gt;
  </code></pre>
  
  <p>The DataContext for the entire Window is set to an instance of the class containing the ICollectionView the DataGrid is bound to.</p>
  
  <p>Every blog or forum post I found was praising the DataGrid's performance so I'm quite obviously doing something seriously wrong. Since I'm quite new to WPF in general and especially to the DataGrid I've no clue of how to improve this. <strong>Does anybody have some advice for me? What's your experience with the DataGrid? What am I doing wrong?</strong></p>
  
  <p>Edit: Just followed <a href="https://stackoverflow.com/questions/697701/wpf-datagrid-performance">this</a> question's advice to set the Width of all columns to "Auto". That did <strong>not</strong> change the bad scrolling performance. Also I'm not using DataGridTemplateColumns (just some DataGridTextColumns and two DataGridComboBoxColumns).</p>
  
  <p>Edit2: I used Snoop to look at my app. What I see suggests that virtualization is indeed working (only 19 rows, not a thousand). But every row contains 52 elements, so those add up to more than thousand elements. Might that be a / the problem?</p>
  
  <p>Thanks a lot!</p>