RT wrote:
Is there any way to make Listview items invisible or otherwise keep
them from displaying? Seems like temporarily removing, then restoring
later would be a severe runtime hit.
Why does it seem like it would be a severe runtime hit?
Have you tried it? Is it in fact a severe runtime hit?
Don't waste time optimizing prematurely. It's simple enough to try just
removing things you don't want shown in the ListView, so try that first.
If it works, great. If not, _then_ you can worry about how to make it
faster.
For what it's worth, I suspect that removing/adding items is much _more_
performant than hiding. When you remove something, it is simply not in
the ListView. If you hide it, then every time the ListView draws, it
needs to know not to draw it, which is extra effort. Since the drawing
happens much more often than the removing/adding, it's better to
remove/add items than keep checking to see whether they need to be drawn
(and of course, doing all the layout, etc. that results from changes in
the shown/hidden state).
Of course, all this is probably moot...I don't think that there is in
fact a way to leave something in the ListView items collection and yet
hide it. But even if there were, I don't think performance would be a
reason to take advantage of that.
Pete