views:

165

answers:

1

I have a glitch in a WinForms C# ListView (with custom modifications to sort and filters on all columns, but it happened also in a standard ListView).

I modify the ListView Items with this (fairly standard) pattern:

BeginUpdate();
// add some items
// remove some other items
Sort();
EndUpdate();

But if I call this code when the ListView is already scrolled, then I get some empty (non selectable) rows before the real items, and 2 scrollabars even if they are not needed.

It looks like a graphic glitch, because when I scroll the list then the empty items disappear.

Have anyone met this problem before?

+1  A: 

Ok, I found the problem. A call to set a column Width = -2 during Resize was messing the owner-draw filters...

Filini