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

Ernesto equistango at gmail.com
Wed Apr 22 14:52:48 EDT 2009


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/c3cc5b49/attachment-0001.html 


More information about the Mono-winforms-list mailing list