I use ListView in VirtualMode to show a very large number of rows, millions of rows. String data stored in a shared list.
Now I want to implement a sort function that sorts the list by some Comparer.
The problem is that at the moment the average single sort takes about 30 seconds, and during this time the user cannot do anything with the ListView and must wait until it ends.
Not every user agrees to wait so long, most users will cancel the sort if they can, and I want to enable this undo feature. Unfortunately, the built-in List.Sort cannot be undone or Array.Sort.
Sorting is currently in a separate thread, so I can use Thread.Abort, but this trial version will result in a damaged list, which is unacceptable to me.
Is there anything I can do but override the whole Sort algorithm myself?
thanks.
source
share