//Hi! I need to put my data into listBox with multiple columns I saw this link stackoverflow.com... but it talks about every thing without mention the way that I can Add Items into the columns would you please just explain how to add Data Items into columns and thanks a lot.I did the following things successfully
<ListView.View>
<GridView>
<GridView.Columns>
<GridViewColumn Header="1" Width="100" DisplayMemberBinding="{Binding Path=Field1}" />
<GridViewColumn Header="2" Width="100" DisplayMemberBinding="{Binding Path=Field2}" />
<GridViewColumn Header="3" Width="100" DisplayMemberBinding="{Binding Path=Field3}" />
</GridView.Columns>
</GridView>
</ListView.View>`
public sealed class MyListBoxItem
{
public string Field1 { get; set; }
public string Field2 { get; set; }
public string Field3 { get; set; }
}
public sealed class MyViewModel
{
public ObservableCollection<MyListBoxItem> Items { get; private set; }
public MyViewModel()
{
Items = new ObservableCollection<MyListBoxItem>();
Items.Add(new MyListBoxItem { Field1 = "One", Field2 = "Two", Field3 = "Three" });
}
}