i have a ListView in wpf
<ListView Name="listArea">
<ListView.View>
<GridView>
<GridViewColumn x:Name="colName" Header="نام تحویلدار" Width="150" DisplayMemberBinding="{Binding Path=name}"/>
<GridViewColumn x:Name="colComboBox" Header="منطقه" Width="120" DisplayMemberBinding="{Binding Path=cb}"/>
</GridView>
</ListView.View>
</ListView>
i want add item to listview. first column is text and secound is comboBox.
foreach(personel ptahvildar in STATICS.db.personels.Where(q=>q.postCode==2))
{
ListViewItem item = new ListViewItem();
ComboBox cbox = new ComboBox();
cbox.ItemsSource = STATICS.db.personels.Where(q => q.postCode == 2);
cbox.DisplayMemberPath = "name";
cbox.SelectedItem = ptahvildar;
item.Content = new { name = ptahvildar.name, cb = cbox };
listArea.Items.Add(item);
}
but the result is like this
why my comboBox not show correctly ?
