C# Datagridview绑定List方法代码


本文实例讲述了c# DatagridView绑定List的方法,分享给大家供大家参考。具体方法如下:

主要代码如下: 

IList<Person> lists; 
 
public Form2() 
{ 
  InitializeComponent(); 

  lists = new BindingList<Person>(); 
  lists.Add(new Person(2)); 
  this.dataGridView1.DataSource = lists; 
   
}

希望本文所述对大家的C#程序设计有所帮助。


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3