简体   繁体   中英

DataGridView with LINQ fast autosave changes

I'm use DataGridView with LINQ BindingSource. And I need autosave changes after adding, editing or deleting rows by:

dataContext.SubmitChanges();

Now I'm use AddedRow, DeletedRow, ValueChanged events, but when user delete 1000 rows, this causes 1000 calls of "dataContext.SubmitChanges();" and this is very slow.

How i can call "dataContext.SubmitChanges();" one time after adding, deleting or editing all rows?

看起来您可以使用bindingSource的List_Changed事件,如此处所述: 使用bindingsource拥有busniess对象

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