How to: Display Subitems in Columns with the Windows Forms ListView Control
.NET Framework 3.0
The Windows Formscontrol can display additional text, or subitems, for each item in the Details view. The first column displays the item text, for example an employee number. The second, third, and subsequent columns display the first, second, and subsequent associated subitems.
To add subitems to a list item
Add any columns needed. Because the first column will display the item'sproperty, you need one more column than there are subitems. For more information on adding columns, see .
Call themethod of the collection returned by the property of an item. The code example below sets the employee name and department for a list item.
// Adds two subitems to the first list item. listView1.Items.SubItems.Add("John Smith"); listView1.Items.SubItems.Add("Accounting");