简体   繁体   中英

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" });
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 technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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