Avatar of Pit76
Flag for Belgium

asked on 

Listview messed up C#

Hi all,

I have a background worker process that gets data from the db and after some manipulations it adds the data to a List<>.
In the RunWorkerCompleted Event I try to load that List<> into my Listview, but here is the problem.
My listview is messed up. My columns disappear and no data is filled.

You can see the code I have in the RunWorkerCompleted Event.

In the scrrenshot you can see the result in the listview, it should normaly contains 7 rows with 2 columns.. The list is not empty, so that isn't the problem. What happens here?? I also added a screenshot of the listview at start up, which is ok.
I can't figure it out. Thx for any help.
 listview_messed up listview at program start, ok
private void backgroundWorkerSearch_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
      toolStripStatusLabelProgress.Text = "Done!!";
      labelResults.Text = string.Format("Found {0} matches.", _contentList.Count);


      foreach (var contentValue in _contentList)
        item = new ListViewItem();
        item.Text = contentValue.guid;

Open in new window


Avatar of undefined
Last Comment

8/22/2022 - Mon