I have four List<ListViewItem>
and one listView control
.
What I want is to populate the control with the items from the lists.
How can I do it?
What I would do is first merge the four lists into one and then add them to the ListView's Items collection.
var allListItems = list1.Concat(list2)
.Concat(list3)
.Concat(list4)
.ToList();
listView.Items.AddRange(allListItems);
This is not very pretty or the best performing solution but it does the job. Take a look at this thread to get a better idea on how to merge more than one list to one.