views:

361

answers:

0

What is the best CRUD design pattern for an editable grid that will be databound to a joined query derived from LINQ?

Background

It's probably irrelevant whether I'm using Telerik's radGridView because this situation may pertain to any list control but I thought that I'd mention that if it helps. At any rate, I have two tables. One table is an "extension" table and I need that data to remain persistent. In the other table I will be testing an import routine and will be deleting/adding data quite often for testing purposes. The other table needs to remain persistent so my end-user will not have to re-enter data if my tests fail in which case I'll make a fix and re-import the data where needed.

So, in order to accomplish this, I need to create a join query and have it displayed by the grid. While my end-user is editing the data, it needs to be saved into the persistent table.

Question

I am using LINQ but do not know the best practice to creating this design. Right off the bat I'm thinking that I'll have to create a stored procedure and on the row changed event, save my changes using the stored proc. However, is there a better way? Is my way acceptable? Can I override LINQ's data context to do this? Am I making it too difficult?

Thank You.