I am trying to put ListView items in my ListView, which is seperated into columns with a GridView object.
I have no idea how to put new items in the columns, and there are not so many useful tutorials on the web.
Here's the XAML code for the ListView:
<ListView Canvas.Left="200" Canvas.Top="68" Height="138" Name="listView1" Width="444">
</ListView>
And the GridView is created dynamically:
public MainWindow()
{
InitializeComponent();
GridView grdView = new GridView();
GridViewColumn nameColumn = new GridViewColumn();
nameColumn.DisplayMemberBinding = new Binding("Time");
nameColumn.Header = "Time";
nameColumn.Width = 120;
grdView.Columns.Add(nameColumn);
GridViewColumn ageColumn = new GridViewColumn();
ageColumn.DisplayMemberBinding = new Binding("Date");
ageColumn.Header = "Date";
ageColumn.Width = 120;
grdView.Columns.Add(ageColumn);
listView1.View = grdView;
}
I want to add some Items into the ListView, how to do that?