Add SubItems to ListView without using XAML

后端 未结 3 1105
自闭症患者
自闭症患者 2021-01-03 06:30

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:

3条回答
  •  情书的邮戳
    2021-01-03 07:09

    SubItem or ListItem?? Easy:

    myListbox.Items.Add(object);
    

    You can add any type of object into that collection or a specific ListBoxItem object like this one:

    this.List.Items.Add(new ListBoxItem{ Content = "Value to display"});
    

提交回复
热议问题