WPF ListView绑定数据不显示
本帖最后由 hhzore 于 2013-09-18 12:30:42 编辑 vs2008 .net 3.5 win7 64bit
window.xaml
<GridViewColumn Header="网络" Width="60" DisplayMemberBinding="{Binding Path=NetType}"/>
<GridViewColumn Header="模式" Width="60" DisplayMemberBinding="{Binding Path=WorkMode}"/>
<GridViewColumn Header="通讯" Width="60" DisplayMemberBinding="{Binding Path=CommMode}"/>
<GridViewColumn Header="IP" Width="60" DisplayMemberBinding="{Binding Path=IP}"/>
<GridViewColumn Header="端口" Width="60" DisplayMemberBinding="{Binding Path=Port}"/>
ObservableCollection<tmp> collection = new ObservableCollection<tmp>();
collection.Add(new tmp(){NetType = vs.NetType, WorkMode = vs.WorkMode, CommMode = vs.CommMode, IP = vs.IP, Port = vs.Port});
ListView1.ItemsSource = collection;