想要仅显示100个要实时更新的列表视图项 [英] Want to display only 100 items of the listview being updated in real time

查看:76
本文介绍了想要仅显示100个要实时更新的列表视图项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个实时更新的列表视图(从硬件跟踪消息).随着列表视图项的不断增长(例如100000).我只想显示最后一百个消息项,并丢弃列表视图中的旧项. br/> 在这方面有任何帮助.
这是Windows窗体应用程序.

I have listview which is updated in real time (trace messages from hardware).As the listview items keeps growing(say 100000 ).I want to display only the last hundred messages items and discard the old items from the listview.
Any help in this regard.
It is windows forms application.

推荐答案

如何获取数据以填充列表视图?过滤.

如果它来自数据库,则添加WHERE子句.如果您正在读取文件,请检查日期/时间值.
How are you obtaining the data to populate the listview? Filter it.

If it is coming from a database then add a WHERE clause. If you are reading from a file, check a date/time value.


您可以使用id排在前100个子句后的order.
希望对您有帮助
you can use order by id descending with top 100 clause.
Hope this may help you


这篇关于想要仅显示100个要实时更新的列表视图项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆