views:

53

answers:

2

Basically I have a Listview control which has coloums (displayed in Detail mode) I add items to it that I want displayed, each under 1 colomn (Like an invoice) but it displays them all under the first instead. I've been adding items like this below which I guess is the wrong way to do it but every other way I tried is not working. You can see he result in the screenshot.

lstVLine.Items.Add(lineItem, lstVLine.Items.Count);  

lstVLine.Items.Add(itemName,lstVLine.Items.Count);

alt text

+4  A: 

You need to create SubItems for each of the additional fields:

ListViewItem item = new ListViewItem ("Something");
item.SubItems.Add ("Brand info");
item.SubItems.Add ("Type info");
lstVLine.Items.Add(item);
Foxfire
Ahh I wondered why subitems never worked, well they do now. ta
Tumble
+1  A: 

Mr. Tumble, you need to add SubItems to each item. A duplicate question can be found here; http://stackoverflow.com/questions/729090/c-how-to-add-subitems-in-listview

Joel Goodwin