I have a ListView and ImageList in C# on my form and read a directory with about 1000 files maximum. I pre-populate the ListView and ImageList with the count of the fileItems DummyItems with the AddRange methods to avoid the flickering and scolling ListView.
Now in the second step I just wanted to assign the right item information to the dummy items while I read the real items from file system. Item text is sofar no problem, but I can't replace the dummy images. It throws always an invalid argument exception if I try to do so. To delete the image with RemoveAtIndex or RemoveAtKey and then re-add would take me ages to iterate through 1000 files. 1000 files take 8 minutes with "RemoveAtKey" in ImageList. "RemoveAtKey" is the bottleneck which I found out. If I try to clear all Images before and re-populate with AddRange again my Item Images go blank or a exception occurs. Does someone know how I get 1000 different thumbnails from 1000 files with the file name fast into a listview control with another methods than I use?