Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get rid of display corruption during horizontal scroll in WPF4 DataGrid with grouping?
    primarykey
    data
    text
    <p>I'm trying to create a datagrid with grouping and I'm getting display corruption (blank areas) during horizontal scrolling. The issue appears <strong>only</strong> when there is a GroupStyle.ContainerStyle defined. The datagrid should contain 200 rows or more to reproduce the problem.</p> <p><strong>UPDATE2:</strong> <a href="https://connect.microsoft.com/VisualStudio/feedback/details/677198/render-glitches-in-wpf4-datagrid-with-disabled-virtualization" rel="nofollow noreferrer">Related Microsoft Connect feedback</a>.</p> <p><strong>UPDATE:</strong> Microsoft guy at <a href="http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/cf47f2e9-e488-42f0-9407-5a668d5c086f/" rel="nofollow noreferrer">social.msdn.com</a> pointed out that adding grouping turns off datagrid virtualization. Possibly that's the root of the problem. I removed grouping from my sample and set <code>VirtualizingStackPanel.IsVirtualizing</code> to <code>false</code> and got exactly the same kind of corruption.</p> <p>Code to reproduce the problem:</p> <pre><code>&lt;DataGrid ItemsSource="{Binding Source={StaticResource ResourceKey=cvsGoods}}" CanUserAddRows="False" CanUserReorderColumns="False" CanUserDeleteRows="False" CanUserResizeRows="False" CanUserSortColumns="False" AutoGenerateColumns="True"&gt; &lt;DataGrid.GroupStyle&gt; &lt;GroupStyle&gt; &lt;GroupStyle.ContainerStyle&gt; &lt;Style TargetType="{x:Type GroupItem}"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate TargetType="{x:Type GroupItem}"&gt; &lt;ItemsPresenter /&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;/GroupStyle.ContainerStyle&gt; &lt;/GroupStyle&gt; &lt;/DataGrid.GroupStyle&gt; &lt;/DataGrid&gt; </code></pre> <p>After several horizontal scrolls to the right and back to the left blank areas appear on the left side. I tried it on WinXP and Win7.</p> <p>The question is: how to get rid of that bug? Is there any workaround? Any suggestions?</p> <p>Screenshot illustrating the problem:</p> <p><img src="https://i.stack.imgur.com/yEd7x.jpg" alt="Display corruption"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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