0
我可以執行以下操作,但它將DataGridView創建爲Readonly。如何使DataGridView在DataSource爲LIst時在WinForms中可編輯<'a>
var entries = (from e in dbContext.Entries
where e.FromWord == "test"
select new {
EntryID = e.EntryID,
WordClass = e.WordClass,
Plural = e.Plural,
FromWord = e.FromWord,
LettersOnly = e.LettersOnly,
Notes = e.notes
}
).ToList();
dataGridView1.DataSource = entries;
如何使DataGridView可編輯?
如果我刪除ToList()我得到一個錯誤,說我必須使用DataSet作爲數據源。有沒有一種簡單的方法來創建一個DataSet。我在Database-First中使用Entity-Framework。
檢查[此鏈接](https://stackoverflow.com/questions/16808590/editable-datagridview-bound-to-a-list) –