Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
In C#,how to quickly add data to the listview control.When a large amount of data need to add,It's very slow,Such as the need to add 10,000 rows of data.Thank you.

add a sentence.I use it in windows forms.
Posted
Updated 20-May-11 5:36am
v2
Comments
Sergey Alexandrovich Kryukov 19-May-11 12:27pm    
Tag it! It's not clear which ListView. You need to tag it: WPF, Forms, ASP.NET, anything else?!
You don't have a chance to get full answer until you tag it all.
--SA
pucx 20-May-11 11:36am    
In Windows forms.
Sergey Alexandrovich Kryukov 20-May-11 23:57pm    
Tag it now! How much longer are you going to delay that?
--SA

I don't think the user need to see so many lines at once. So many rows won't feet on a computer screen anyway. You need to virtualize ListView control by using ListView.VirtualMode property (I don't know what library you're using, but idea would be the same). In this way, the data will be fed to the control on demands in smaller portions. Better yet, you could provide part of data in response to search query.

In relationship to the performance of the operations of population the control with data, learn about data binding.

Again, you need to find further details by yourself, as you did not tag the UI library you use.

—SA
 
Share this answer
 
Would this article help you?

A Much Easier to Use ListView[^]

Good luck :)
 
Share this answer
 
http://msdn.microsoft.com/en-us/library/bb398790.aspx[^]

Have a look in this link. Its a good one.
 
Share this answer
 

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