WPF DataGrid is very slow to render

后端 未结 10 2013
我在风中等你
我在风中等你 2020-12-23 02:30

I have tried using both a customized DataGrid as well as the stock one in WPF. I have tried populating them manually as well as through bindings. In both cases they are sl

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-23 02:46

    Are you have:

    • Enabled VirtualizingStackPanel.VirtualizationMode for a Grid? if not - try to set.
    • Set VirtualizingStackPanel.IsVirtualizing="true" for DataGrid
    • Wrapped up a Grid by a StackPanel container? If yes - try to remove.
    • Wrapped up a Grid by an external ScrollViewer control? If yes - try to remove.

    One more point, could you bind whole items collection at once instead of adding each item into the grid.Items collection?

提交回复
热议问题