简体   繁体   English

从DataGridView获取对象列表?

[英]Get a list of objects from DataGridView?

I am binding a list of objects to a DataGridView like the following 我将对象列表绑定到DataGridView ,如下所示

var list = new List<Value>();
list.Add(new Value() { Name = "test" });
list.Add(new Value() { Name = "second" });

dataGrid.DataSource = list;

After inserting, editing, deleting... how can I retrieve a List<Value> from the DataGridView ? 插入,编辑,删除后...如何从DataGridView检索List<Value>

The gridview edits your existing list. gridview编辑现有列表。

The list will reflect the current contents of the gridview. list将反映gridview的当前内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM