WPF Data virtualizing ListView

时光怂恿深爱的人放手 提交于 2019-11-29 07:30:01

问题


In our current WinForms app, we are displaying millions of records in ListView, using virtualization. Rows are loaded from DB as they are requested. This works well, with good performance.

This is a showstopper for migrating to WPF for us. We need data virtualization in a ListView, like WinForms 2.0 has.

Do you know a decent third-party control, or a relatively easy way of doing it with built-in controls? It doesn't need to be a DataGrid, a simple ListView will suffice.

Note, I'm note talking about UI virtualization, it's data virtualization.


回答1:


The article WPF Data Virtualization should be exactly what you are looking for, I just implemented it quite easily, and it works.




回答2:


Xceed DataGrid for WPF has data virtualization support.




回答3:


This is the description for the Ultimate ListBox for WPF from Xceed:

Intelligent virtualized background data retrieval:

Automatic data retrieval only gets records from the remote data source if they are visible (data virtualization). This greatly reduces the amount of data to be transferred, which increases the perceived speed of the listbox. Also reduces strain on the server.




回答4:


Just add following properties in your listview declaration in XAML.

<ListView 
      VirtualizingPanel.IsVirtualizing="True"
      VirtualizingPanel.IsVirtualizingWhenGrouping="True"
      VirtualizingPanel.VirtualizationMode="Recycling"
      ScrollViewer.IsDeferredScrollingEnabled="True" >
</ListView>


来源:https://stackoverflow.com/questions/981040/wpf-data-virtualizing-listview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!