This is a migrated thread and some comments may be shown as answers.

[Solved] Sample for editing a master detail relationship

1 Answer 137 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Richard
Top achievements
Rank 1
Richard asked on 08 Dec 2010, 10:19 PM
Hi guys,

I'm looking for some help in creating a master detail view whereby I can inline edit the details within a single view of the master.

I've seen the master detail grid example but that isn't exactly what I'm after.

Here is my scenario:

I have an Order screen which has a one to many relationship with OrderDetails. From a list of orders, the user will Edit an individual order and that edit view will show the list of order detail items. I want the user to be able to insert/edit an individual order item and then save the order as a whole.

So basically the model is:

    public class Order
    {
        [Key]
        public int OrderID { getset; }

        public virtual ICollection<OrderItem> OrderItems{ getset; }
        }

    public class OrderItem
    {
        [Key]
        public int OrderItemID { getset; }         public virtual Product Productgetset; }
        public int Quantity { getset; }
        public virtual Order Order{ getset; }
        }

Has anyone else pulled this off or are there any additional samples out there?

1 Answer, 1 is accepted

Sort by
0
Jo
Top achievements
Rank 1
answered on 29 Nov 2011, 05:24 PM
I am looking for a similar feature... Has anyone else attempted this before?
Tags
General Discussions
Asked by
Richard
Top achievements
Rank 1
Answers by
Jo
Top achievements
Rank 1
Share this question
or