Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pointless ItemCheck events in ListView derivate

Status
Not open for further replies.

dascandy

Programmer
Jul 19, 2005
6
NL
I have a program in which a listview in detail view is displayed on a not directly visible tab. I add a load of items to it (around 33000) and then focus the tab on which it is. At that time, it sends out 33000 ItemCheck events, one for each item, in which it deselects it. The items were added nonchecked (verified).

My problem is that each ItemCheck event has to redraw a complex structure, which takes about a second to two seconds for 33000 items. If it does that for each ItemCheck event, it takes around a workday to actually reach the tab opposed to a second. That's kind of unacceptable performance.

Is there a way to not make it send out these pointless ItemCheck events or is it something I'm forced to hack around?
 
Oh, I should add:

The items are added in around 20 AddRanges. When I first focus the tab, then add the items, and then refocus it, it doesn't fire any of those events.
 
yourListView.SuspendLayout();

yourListView.Items.Add(youritems);

yourListView.ResumeLayout();
 
Nope, it still sends out 33000 requests upon focussing the tab page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top