Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to update listview without crashing the program?

$
0
0

So I have a listview that I constantly update from multiple treads and while at first it works just fine as more and more entrires are loaded it slows the program down more and more until it crashes the method that updates the listview looks like this:

listView1.Invoke((MethodInvoker)(() => {
                ListViewItem item1 = new ListViewItem(username, 0);
                item1.SubItems.Add(email);
                item1.SubItems.Add(password);
                listView1.Items.AddRange(new ListViewItem[] { item1 });
            }));   

How do I fix this issue?


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>