一个非常简单的WPF数据网格绑定到图像列表。在使用divider(或主窗口本身)调整列的大小时,CPU会达到100%,并且应用程序会进入无限循环的排列/调整大小,导致窗口内容来回跳动,并且没有更多的用户输入被处理(锁定)。我该如何解决这个WPF datagrid无限量度/排列错误?
数据网格定义为:
<DataGrid ItemsSource="{Binding ImageList}" AutoGenerateColumns="False" x:Name="ImageGrid">
<DataGrid.Columns>
<DataGridTemplateColumn Header="Image 1" Width="40*">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="{Binding ImagePath}" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="EmptyText" />
</DataGrid.Columns>
</DataGrid>
- 甲video of the problem is here(请原谅穷人编码)。我的very simplified test project is here。
- 我想这是在Microsoft Connect here上描述的这个bug。
事情我已经尝试:
- 继承的DataGrid和压倒一切的安排/测量网格。
- 覆盖窗口的排列/度量。
- 调整网格滚动条,将其关闭和各种选项。
我不能做什么:
- 升级到.NET 4.5是不是在这个项目中的一个选项。
- 删除列,那么网格中就没有点。
有没有办法解决.Net 4.0中的这种行为?如果没有,我将不得不考虑一种解决方法,比如使用别的东西来代替网格,尽管我花了很多年的时间来设计它,并且不愿意失去这个工作。
在此先感谢
我现在面临着和你一样的问题。不幸的是,这个解决方案对我无效。 – 2015-07-21 09:39:39