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 content within the ListViewItem that will go under the first, second, and third columns individually. So far, I have only gotten this far:
ListViewItem l = new ListViewItem();
l.Content = "Content";
myListView.Items.Add(l);
This sets each column to the string "Content". How can I change the code above so that I can add a ListViewItem that will display "Content 1", "Content 2", and "Content 3" under the first, second, and third columns respectively? I tried to look for a SubItem or ListViewSubItem property within ListViewItem, but found nothing.
I assume there's a simple solution, but maybe I'm wrong. Please do not mention data binding, because I only want an answer to the question of programmatically setting the Content property to reflect individual changes in each column.
Thank you very much.