When I'm developing ASP.NET applications I often create forms that allow users to create, retrieve, or update records in a database. Many times there's a need to be able to add child records to an item I am creating, such as adding a category to a product or some sort of order / order detail relationship. Normally I use some sort of DropDownList to show a list of possible child records, and then a DataGrid to show which children are already a part of the parent. Currently, the only way I know to accomplish this in ASP.NET requires that I first save the parent record to the DB so that I can assign PK/FK relationships so I am able to DataBind the DataGrids that hold the child records.
What I'd like to know is if there is some way I could implement the form so that I could add or remove records from these DataGrids but not actually commit the changes until the user clicks 'Save' to create or update all the required records at once. I'm starting to migrate from using SubSonic to LINQ if that would work better for the DataBinding. It seems pretty difficult with the statelessness of HTTP.
Any thoughts are greatly appreciated,
Mike