wpf代码实现listview绑定数据
程序员文章站
2022-03-07 17:04:07
...
((GridView)listview.View).Columns[0].DisplayMemberBinding = new Binding { Path = new PropertyPath("name") };
((GridView)listview.View).Columns[1].DisplayMemberBinding = new Binding { Path = new PropertyPath("ip") };
((GridView)listview.View).Columns[2].DisplayMemberBinding = new Binding { Path = new PropertyPath("port") };
listview.ItemsSource = _config;
可以扩展为设置标题
上一篇: 单例模式的几种实现方法