WPF的ListView怎么动态的添加数据
推荐于2016-01-05
展开全部
listView.Items.Add(要增加的对象),代码如下:
var p = new Person { Name = "张三", Address = "上海市乳山路", Sex = SexEnum.男 };
listView.Items.Add(p);
//Help class
public enum SexEnum { 男, 女 }
public class Person
{
public string Name { get; set; }
public string Address { get; set; }
public SexEnum Sex { get; set; }
}
var p = new Person { Name = "张三", Address = "上海市乳山路", Sex = SexEnum.男 };
listView.Items.Add(p);
//Help class
public enum SexEnum { 男, 女 }
public class Person
{
public string Name { get; set; }
public string Address { get; set; }
public SexEnum Sex { get; set; }
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询