Lets say I have a Master/Detail form bound to Linq2Sql objects (for arguments sake an Order / Order Line form)
The order form shows the order lines in a datagrid, which is readonly
To add/edit an order line the user clicks a button.
The button opens up another form and the details are entered and when the user clicks save the record is added.
AI could pass an order line object to the form and show it modal,if the user clicks save the form returns true
Pseudo Code :
However I would like the form to not be modal, in which case I cant do the
Order.OrderLines.Add(OLine)
part on the parent form as i dont know whether the user clicked save or cancel.
I tried passing the Order.OrderLines collection ByRef to the child and doing the Add there, however I loose the ByRef when i store the collection in a variable to use when the Save button is clicked.
Does anyone have any suggestions how to handle adding items to a collection on a parent form, without using Modal child forms?
Cheers,
Daniel
The order form shows the order lines in a datagrid, which is readonly
To add/edit an order line the user clicks a button.
The button opens up another form and the details are entered and when the user clicks save the record is added.
AI could pass an order line object to the form and show it modal,if the user clicks save the form returns true
Pseudo Code :
Code:
NewLineButton_Click
dim OLine as new OrderLine
dim f as frmOrderLine
If f.AddOrderLine(OLine) = true Then
Order.OrderLines.Add(OLine)
End if
End Sub
However I would like the form to not be modal, in which case I cant do the
Order.OrderLines.Add(OLine)
part on the parent form as i dont know whether the user clicked save or cancel.
I tried passing the Order.OrderLines collection ByRef to the child and doing the Add there, however I loose the ByRef when i store the collection in a variable to use when the Save button is clicked.
Does anyone have any suggestions how to handle adding items to a collection on a parent form, without using Modal child forms?
Cheers,
Daniel