C# Datagridview绑定List方法代码

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

主要代码如下: 

1
2
3
4
5
6
7
8
9
10
11
IList<Person> lists;
  
public Form2()
{
  InitializeComponent();
 
  lists = new BindingList<Person>();
  lists.Add(new Person(2));
  this.dataGridView1.DataSource = lists;
    
}

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

posted @ 2017-03-02 12:04  Net-Spider  阅读(1263)  评论(0)    收藏  举报