Edit one to many?

Posts   
 
    
JustBarno
User
Posts: 4
Joined: 13-Dec-2007
# Posted on: 13-Dec-2007 22:57:45   

I've got a product edit form, using a formview bound to my product LLBLGenProDatasource. So far everything has been great, and very self explanitory, however, my product can have many suppliers, and i'd like to have the ability to add/remove those suppliers from a table of existing ones.

Is there a way to use LLBL out of the box to accomplish that using the setup below?

Product Table (update already working) Product>Supplier relationship table (add/remove from here, for the selected product) Supplier table (just use to display the supplier names)

Sorry, I didn't generate the files, and i'm brand new to the product, so far I love it though! Might just need to get me a copy for my own personal use!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Dec-2007 09:37:21   

my product can have many suppliers

That's a m:n relation. Anyway you may just set the LLBLGenProDataSource's LivePersistence to false and handle the PerformWork yourself to Save the related entities along with the Prodcut that's about to be saved using the same UoW object.

For databinding examples with and without LivePersistence please check the ASP.NET 2.0 databinding example solution from v2.5 download page on the web site.