Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>All righty per this post:</p> <p><a href="https://stackoverflow.com/questions/2783845/wpf-virtualizing-an-itemscontrol">Virtualizing a WPF ItemsControl</a></p> <p>I didn't have the <strong>Scrollviewer.CanScroll='true'</strong> in WPF virtualizationstackpanel doesn't seem to work without it. </p> <p>Thanks all who posted solutions to help me along the way. You guys didn't have the solution so I didn't mark it as correct; however, I gave you guys upvotes because you both helped along the way. Here's the final XAML so you can see what the itemscontrol needs to look like:</p> <pre><code> &lt;ItemsControl ScrollViewer.CanContentScroll="True" VirtualizingStackPanel.VirtualizationMode="Recycling" ItemsSource="{Binding UsersAvailForEmail}" MaxHeight="400"&gt; &lt;ItemsControl.ItemsPanel&gt; &lt;ItemsPanelTemplate&gt; &lt;VirtualizingStackPanel /&gt; &lt;/ItemsPanelTemplate&gt; &lt;/ItemsControl.ItemsPanel&gt; &lt;ItemsControl.Template&gt; &lt;ControlTemplate&gt; &lt;ScrollViewer x:Name="ScrollViewer" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" IsDeferredScrollingEnabled="True" Padding="{TemplateBinding Padding}"&gt; &lt;ItemsPresenter/&gt; &lt;/ScrollViewer&gt; &lt;/ControlTemplate&gt; &lt;/ItemsControl.Template&gt; &lt;ItemsControl.ItemTemplate&gt; &lt;DataTemplate&gt; &lt;Border Style="{StaticResource onmouseover}" BorderThickness="0,0,1,1"&gt; &lt;CheckBox Margin="20,5" IsChecked="{Binding IsSelected}"&gt; &lt;CheckBox.Content&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;TextBlock Width="20"/&gt; &lt;TextBlock Width="70" Style="{StaticResource textBlockBaseStyle}" Grid.Column="1" Text="{Binding FirstName}"/&gt; &lt;TextBlock Width="70" Style="{StaticResource textBlockBaseStyle}" Grid.Column="2" Text="{Binding LastName}"/&gt; &lt;TextBlock Width="70" Style="{StaticResource textBlockBaseStyle}" Grid.Column="3" Text="{Binding Action}"/&gt; &lt;TextBlock Width="60" Style="{StaticResource textBlockBaseStyle}" Grid.Column="4" Text="{Binding ActionId}"/&gt; &lt;/StackPanel&gt; &lt;/CheckBox.Content&gt; &lt;/CheckBox&gt; &lt;/Border&gt; &lt;/DataTemplate&gt; &lt;/ItemsControl.ItemTemplate&gt; &lt;/ItemsControl&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload