如何使用来自数据库的数据实现 WPF DataVirtualization?
我有一个连接到 WCF 服务的应用程序,该服务从 SQL Server 数据库存储过程收集数据。从 UI 方面,我阅读了许多关于使用 DataVirtualization 来优化大量数据显示的文章。
但是在阅读了很多内容之后,不清楚我应该如何为来自数据库的数据实现这样的解决方案。
我是否必须从表中调用一次所有记录,然后从 UI 端处理整个虚拟化,或者数据库是否应该已经返回 PAged 记录?
如果你们中的一些人在 UI 端有 SQl 数据和虚拟化的示例实现或显示这一点的良好链接,我将很高兴。
目前,我已经看到了带有示例集合演示的示例项目,但没有任何针对数据库的内容。
I have an application which is connected to a WCF service collecting data from an SQL server database store procedure. From the UI side i have read many article on the use of DataVirtualization in order to optimized displaying large amount of data.
BUt after reading quite many it is ot clear how should I implement such solution for my data coming from my database.
Do i have to call all my records once from table, and then handle the whole virtualization from UI side or does the database should already return PAged records ?
I will be glad if some of you have sample implementation with SQl data and Virtualization on UI side or good link which shows that.
For time beeing I have see sample project with sample collection demo, but nothing against database stuff.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
数据虚拟化和UI虚拟化是不同的概念。 WPF 不提供开箱即用的数据虚拟化,但它提供 UI 虚拟化。
您的数据来自数据库这一事实与客户端内的数据虚拟化无关。它可能来自 WCF 服务、数据库、XML 文件等......这是不相关的。您在数据库和其他面向性能的项目中利用的缓存机制确实很重要,但这超出了数据虚拟化的范围。
如果您真正追求的是客户端内的数据虚拟化,请查看 Bea 的博客文章关于这个主题有几个解决方案以及一个很好的解释。
Data virtualization and UI virtualization are different concepts. Out of the box, WPF does not offer data virtualization but it does offer UI virtualization.
The fact that your data is coming from a database is irrelevant with regard to data virtualization within the client. It could be coming from a WCF service, a database, an XML file, etc... that is irrelevant. The caching mechanisms you leverage within the database and other performance oriented items do matter but that is outside the scope of data virtualiztion.
If what you are after is indeed data virtualization within the client, check out Bea's blog post on the topic which has a couple of solutions as well as a great explanation.