开发者

Get a list of objects from DataGridView?

I am binding a list of objects to a DataGridView like the following

var list = new List<Value>();
list.Add(new Value() { Name = "test" });
开发者_JAVA技巧list.Add(new Value() { Name = "second" });

dataGrid.DataSource = list;

After inserting, editing, deleting... how can I retrieve a List<Value> from the DataGridView?


The gridview edits your existing list.

The list will reflect the current contents of the gridview.


The DataSource property should contain those changes.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.datasource.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜