Hi. I have a page like Order - Order lines. Order represents by some textboxes and ddls, Order lines represents by GridView.
I want to let users add order lines without save changes to database. For example: he adds 4 order lines, fill order info and then hits Save button. Only an that moment all information should be saved to DB.
When I use code like
using (Entities ctx = new Entities())
{
//create new OrderLine
OrderLine ol = OrderLine.CreateOrderLine(1, 1, "", 1);
//add OrderLine to OrderLines collection
ctx.CreateOrderLines.AddObject(ol);
}
newly created OrderLine does not appears in my object context, so I can't access it and bind GridView to new OrderList collection.
How can I solve this problem? Or maybe there are another ways to perform this task?
Thanks.