[Mono-winforms-list] Very slow performance in WinForms ListView

Kolhe, Jyoti B jyoti.b.kolhe at intel.com
Wed Apr 22 15:02:00 EDT 2009


Thanks for the tip. This helped my list view performance.

-Jyoti
________________________________
From: Ernesto [mailto:equistango at gmail.com]
Sent: Wednesday, April 22, 2009 11:53 AM
To: Kolhe, Jyoti B
Cc: mono-winforms-list at lists.ximian.com
Subject: Re: [Mono-winforms-list] Very slow performance in WinForms ListView

Le 22/04/2009 14:33, Kolhe, Jyoti B a écrit :

I'm extensively using ListView (several forms with different listviews

with thousands of items each) with Mono 2.4 under Fedora 11 Beta,

openSUSE 11.1 and Mono SVN on Ubuntu 9.04 RC. Performance if very good

and loading a listview with 5000 items will always take less than a

second, even on an old Athlon XP.





Did you get good performance by using BeginUpdate() and EndUpdate() calls on the listview or even without them?





I always use BeginUpdate and EndUpdate. Usually, I also use the form's SuspendLayout() and ResumeLayout() methods, like this:

<pre>

this.SuspendLayout();
MyListView.BeginUpdate();
MyListView.Items.Clear();

for(;;) {
    ListViewItem Itm = MyListView.Items.Add(blah blah);

    Itm.SubItems.Add(blah blah);
    Itm.SubItems.Add(blah blah);
    Itm.SubItems.Add(blah blah);
}

MyListView.EndUpdate();
this.ResumeLayout();

</pre>

"this" beign the container form.

Hope it helps.

Regards,
Ernesto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-winforms-list/attachments/20090422/85210584/attachment.html 


More information about the Mono-winforms-list mailing list