Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, in this code list view take much more time to display all data, please tell me what should I do to increase the performance of list view item to display.

C#
int length = Int32.Parse(numericUpDown2.Value.ToString());
            string temp;
             listView1.View = View.Details;
            listView1.Items.Clear();
            for (int i = 0; i> 999; i++)
            {
                temp = MakePassword1(length);
                Refresh();
                listView1.Items.Add(temp.ToString());
            }
Posted
Updated 14-Mar-11 22:05pm
v2

1 solution

You can only have problems if your List view is trying to hold too many items. The only alternative I can see is using the virtual mode. In this way, you will not keep a copy of all your data in the instance of your list view.

See for explanation and a code sample: http://msdn.microsoft.com/en-us/library/system.windows.forms.listview.virtualmode.aspx[^].

—SA
 
Share this answer
 
v2
Comments
JF2015 15-Mar-11 4:10am    
Very good advice. 5+
Sergey Alexandrovich Kryukov 15-Mar-11 4:11am    
Thank you.
--SA
Espen Harlinn 15-Mar-11 12:48pm    
Good link - 5ed :)
Sergey Alexandrovich Kryukov 15-Mar-11 13:26pm    
Thank you. MSDN shows what do to in such cases :-)
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900