【发布时间】:2016-12-20 12:49:45
【问题描述】:
我有这个ListView:
<ListView name="listView1" />
我想在代码后面添加 Row 和几个字段:
1. string
2. Combobox
3. Checkbox
这是我尝试过的:
List<string> list = new List<string>();
tests.Add("Select country");
tests.Add("USA");
tests.Add("Germany");
ComboBox combobox = new ComboBox();
combobox.ItemsSource = options;
CheckBox checkbox = new CheckBox();
ListViewItem itm;
object[] abjects = new object[3];
abjects[0] = "my name" as string;
abjects[1] = combobox as ComboBox;
abjects[2] = checkbox as CheckBox;
itm = new ListViewItem();
itm.Content = abjects;
listView1.Items.Add(itm);
目前,结果是在我看到的每一列中Object[] Array
【问题讨论】: