它是用于调用的BeginUpdate / EndUpdate与虚拟列表视图 [英] Is it useful to call BeginUpdate/EndUpdate with a virtual listview

查看:261
本文介绍了它是用于调用的BeginUpdate / EndUpdate与虚拟列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得在这几百项的列表视图虚。我必须通过清除它,然后添加新/更新的项目给它定期更新列表视图乐

I've got a virtual listview with a few hundreds items in it. I must regularly update le listview by clearing it and then adding the new/updated items to it.

它是用于调用BeingUpdate和EndUpdate,而这样做?我不能发现任何视觉上的差异。

Is it useful to call BeingUpdate and EndUpdate while doing this? I could not notice any visual difference.

感谢

推荐答案

有可能是一个巨大的优势,使用的BeginUpdate EndUpdate ,如果你在一次改变多个项目。如果你一次只添加一个单一的元素,就没有优势。

There can be a huge advantage to using BeginUpdate and EndUpdate, if you're changing many items at once. If you're only adding a single element at a time, there will be no advantage.

话虽这么说,它通常最好只使用<一个href=\"http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.listviewitemcollection.addrange.aspx\"相对=nofollow> 的AddRange ,它允许您添加在一个单一的通话多个项目,而不必担心的BeginUpdate / EndUpdate

That being said, it's typically better to just use AddRange, which allows you to add multiple items in a single call without worrying about BeginUpdate / EndUpdate.

这篇关于它是用于调用的BeginUpdate / EndUpdate与虚拟列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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