ListView异步虚拟模式 [英] Listview asynchrone virtul mode
问题描述
如何在虚拟模式下填充列表视图(我要添加几千个ListViewItem).我不知道要预先添加多少个项目,我必须异步添加项目.
我添加了方法"RetrieveVirtualItem",它是:"e.Item = listOfItems [e.ItemIndex];"
另一个类创建listviewitem"lvi",并将其添加到listOfItems.
出现以下异常:对象引用未设置为对象的实例.",当我这样做时:创建了"lvi"
How can I populate a listview in virtual mode(I have several thousand of ListViewItem to add). I do not know how many items to be added in advance, I must add items asynchronously.
I added the method ''RetrieveVirtualItem'', which is: ''e.Item = listOfItems[e.ItemIndex];''
Another class creates the listviewitem ''lvi'' and adds it to listOfItems.
The following exception appears: ''Object reference not set to an instance of an object.'', when I do: ''lvi.ListView.Invoke...'' in the class that created the ''lvi''
推荐答案
看看更易于使用的ListView [ ^ ]
会为您完成所有这一切.
Take a look at A Much Easier to Use ListView[^]
which will do all this for you.
这篇关于ListView异步虚拟模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!