I'm binding the results of a linq-to-sql query to a datagridview. This works fine if I'm just selecting from a single database table. However, if it's a join query where I'm selecting fields from both tables, then because the select is going into an anonymous type, the results are readonly. Hence my datagridview is also readonly. I want the fields in the DGV to be editable.
If I create a non-anonymous type, and use that in the linq query, then the DGV is editable, but calling the SubmitChanges() method doesn't work. I know I could manually fill in the results before calling SubmitChanges(), but it feels like there should be a better way of doing this. Especially given that it must be a fairly common task.
What's the recommended way of doing this?
Thankyou for any help,
Dan.