views:

233

answers:

1

Visual Studio 2008, .Net 3.5

I am populating a ListView with 100+ items, about 10 columns each. I find that after some horizontal and vertical scrolling my column headers get corrupted with snippets of data from the items.

For example, a ListView with a column "Animals" with items that have "Dog", "Cat", "Pig", "Horse" in that column, and another column "Lives In" with items that have "House", "House", "Sty" and "Stable" in that column. If I scroll some, after awhile, column "Animals" might say "Pig" or even "House". If I re-size the column to be very narrow, the partial text will be correct. If I put a message box in to tell me the column text upon selection, it shows the proper text.

Ideas?

A: 

You could try calling .Refresh() on the ListView to force it to repaint after the scrolling is finished.

Zach Johnson
I thought so too, but it does not help. I tried it on the ListView object itself, as well as the form. I considered just doing a complete clear on the ListView object, but that seems like too much of a hassle - then I have to rebuild the columns, try to capture user-column sizes, etc.
GTAE86