I have a ListView with 3 headers declared in XAML as follows:
<ListView Name="myListView">
<ListView.View>
<GridView>
<GridViewColumn Header="H1"/>
<GridViewColumn Header="H2"/>
<GridViewColumn Header="H3"/>
</GridView>
</ListView.View>
</ListView>
I want to programmatically add a ListViewItem to this ListView, being able to set the contents of the ListViewItem, which will go under the first, second and third columns separately. So far, I just got this:
ListViewItem l = new ListViewItem();
l.Content = "Content";
myListView.Items.Add(l);
This sets each column to the "Content" row. How can I modify the above code to add a ListViewItem that displays "Content 1", "Content 2" and "Content 3" under the first, second and third columns respectively? I tried to find the SubItem or ListViewSubItem property in the ListViewItem, but did not find anything.
, , , , . , , Content, .
.