I am implementing a system using C# ( Windows Forms ) with Entity Frame work and Linq.
The DataGridView
works well when using normal linq statement, but when I used "Join", the DataGridView
Become read Only and I cant edit anything.
Example: DataGridView work well with this statement :
var query = from d in db.Device select d;
dgvDevices.DataSource = query.ToList();
but it become non-editable with this query :
var query = from u in db.Users join d in db.Device on u.id equals d.AssignedTo
select new { d.id, d.Name, d.OwnerName,
d.OwnerPhoneNumber, d.Details, User = u.Name };
dgvDevices.DataSource = query.ToList();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…