简体   繁体   English

在gridview中显示增量数据的最佳方法是什么?

[英]What is the best way to show incremental data in a gridview?

I am building a monitoring application. 我正在构建一个监控应用程序。 Data is presented to a user in a girdview. 数据在girdview中呈现给用户。 This data changes frequently(an application adds 5-6 entries every second). 此数据经常更改(应用程序每秒添加5-6个条目)。 Total number of entires loaded may be a few thousand. 加载的entires总数可能是几千。

What is the best way to load these rows into gridview? 将这些行加载到gridview中的最佳方法是什么?

Should I load data incrementally? 我应该逐步加载数据吗? And add each row manually? 并手动添加每一行?

Or 要么

Would calling DataBind again be too expensive? 再次调用DataBind会太贵吗? I have noticed a flicker on screen with this approach and so don't want to use this. 我注意到这种方法在屏幕上闪烁,所以不想使用它。

Are there any better methods to populate a gridview with incremental data? 有没有更好的方法用增量数据填充gridview?

I am building a monitoring application. 我正在构建一个监控应用程序。 Data is presented to a user in a grid view. 数据以网格视图呈现给用户。 This data changes frequently(an application adds 5-6 entries every second) 此数据经常更改(应用程序每秒添加5-6个条目)

Can the human eye catch 5-6 updates a second? 人眼能否在一秒钟内获得5-6次更新? I think your good with one update every 500 ms. 我觉得你的好处是每500毫秒更新一次。

Performance tips: 表现提示:

  • Use BindingList or List. 使用BindingList或List。 Stay away from datatable/dataset. 远离数据表/数据集。

  • Maintain a cache of all the updates. 维护所有更新的缓存。 Use a timer with 500 ms interval, update the List datasource from the cache when interval elapses. 使用间隔为500毫秒的计时器,在间隔过去时从缓存中更新列表数据源。

  • Refresh the CurrencyManager and do not rebind the grid . 刷新CurrencyManager并且不重新绑定网格

    CurrencyManager currencyManager = (CurrencyManager)this.BindingContext[Grid.DataSource]; CurrencyManager currencyManager =(CurrencyManager)this.BindingContext [Grid.DataSource]; currencyManager.Refresh(); currencyManager.Refresh();

我认为逐步加载数据是更好的选择,特别适合监控应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM