ListView Items disappear on resize
Posted on 2008-06-10
I wonder if anyone has run across this. I have a ListView in a form inside a splitter panel. It is anchored on all sides of the panel., as is the splitter control on all sides of the form. So if I have several items in the listview and begin to remove some rows (I have a button that just removes any selected items) and resize the form (thereby resizing the listview), at some point all the items in the list view will disappear. If I click on them or select them they will reappear individually. It's as if the text somehow got changed to white-on-white, but clicking on them brings them back to normal.
It gets worse. When this happens, there is some blank space at the top, between the border and the first item, about the height of two rows but it's just empty space, not rows.. In all of this I have not added any items other than my initial ones. I do have one callback on the resize for the control, where I adjust the column widths but that's all. I can get it to reproduce by using the delete and resize, but others can do it with only using the delete, and sometimes it manifests by making all the rows after the deleted one disappear until they are clicked on.
This may be too vague, I'm trying to see if I can isolate what I need to do to cause it but so far I can't. It is really puzzling to me. My searches haven't pulled anything up. I'm using Visual Studio 9.0.21022.8 with C#, it happens on both Vista and XP SP2.