C # MultiColumn Listbox

I have the following two codes

List<string> _items = new List<string>(); List<string> _items2 = new List<string>(); 

I want to add both of them to one multi-column Listbox

Column 1 may be _items, while Column2 may be _items2

I don't know how to add items2 to the second column

I added _items to the list from

 Listbox1.DataSource = _items 

thanks

+2
source share
1 answer

The above answer did not help me using .NetCF, this is a small change:

 myListView.Columns.Add("Nr"); //column 1 heading myListView.Columns.Add("Desc"); //column 2 heading myListView.View = View.Details; //make column headings visible foreach (var item in someDataList) //item has strings for each column of one row { // create new ListViewItem ListViewItem lvi = new ListViewItem(item.Text1); lvi.SubItems.Add(item.Text2); // add the listviewitem to a new row of the ListView control myListView.Items.Add(lvi); //show Text1 in column1, Text2 in col2 } 
+2
source

All Articles