Add SubItems to ListView without using XAML
问题 How do you add sub-items to a ListView ? I need to generate everything dynamically, but every example I've found uses XAML. Non-WPF was so simple: ListViewItem lvi = listview.items.add(wahtever); lvi. blah blah blah How do you add sub-items in WPF without using XAML? 回答1: As already mentioned, WPF doesn't have sub-items like WinForms. Instead you use properties on an object that suits your purposes. For completeness, here is XAML contrasted with code. XAML: <UniformGrid Columns="2"> <ListView