Master detail with LLBLGenProDataSource

Posts   
 
    
zulu
User
Posts: 50
Joined: 25-Aug-2008
# Posted on: 25-Aug-2008 02:03:46   

Hello, I know this has been discussed before but wasn't able to understand how this should be done.

Basically I have the following scenario:

A formview or details view bound to the 'master' data. A gridview bound to the 'details'.

Let's say master data is Customer and details is CustomerOrders.

In my web page I have created two LLBLGenProDataSource instances as indicated in other threads.

Now, when I land on my webpage to 'edit' a customer, the customer's id is passed on the querystring and I can use this to tell both datasources how to fecth the data they need by configuring the 'select parameters'.

All works fine and I can add rows to the 'details' gridview and they get persisted.

However, if I want to land on my webpage to add a 'new' customer and related orders, things don't really work.

So basically my question is how to link the two datasources together, or how to configure the 'orders' datasource so that it uses Customer.Orders instead of fetching the data by itself using 'select parameters'.

Perhaps the anwer to my question lies in turning LivePersistence off and doing things manually?

I hope I made myself clear.

Simone

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 25-Aug-2008 03:15:30   

Hi Simone,

Maybe you should try the WebDatabinding example at http://llblgen.com/pages/examples.aspx , it has good examples of that.

David Elizondo | LLBLGen Support Team
zulu
User
Posts: 50
Joined: 25-Aug-2008
# Posted on: 25-Aug-2008 03:33:00   

daelmo wrote:

Hi Simone,

Maybe you should try the WebDatabinding example at http://llblgen.com/pages/examples.aspx , it has good examples of that.

Hi, I did look at those examples and unless I missed something they don't really demonstrate how to accomplish what I am trying to do.

Specifically, I used the CRUD example which helped me a lot but it doesn't have a master/detail.

If you can point me to a specific example which does I would be grateful.

Thanks Simone

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 25-Aug-2008 11:03:41   

Please check the ASP.NET 2.0 databinding example, not the CRUD one.

Running the application, in the home page, you will find the following links:

  • The fifth example is showing Master-Details databinding using a FormView(Master) and a GridView(Details) while LivePersistence is turned On.

  • The sixth example is showing Master-Details databinding using a GridView(Master) and a FormView(Details) while LivePersistence is turned Off.

zulu
User
Posts: 50
Joined: 25-Aug-2008
# Posted on: 28-Aug-2008 01:54:21   

Walaa wrote:

Please check the ASP.NET 2.0 databinding example, not the CRUD one.

Running the application, in the home page, you will find the following links:

  • The fifth example is showing Master-Details databinding using a FormView(Master) and a GridView(Details) while LivePersistence is turned On.

  • The sixth example is showing Master-Details databinding using a GridView(Master) and a FormView(Details) while LivePersistence is turned Off.

Hi, thanks...

I checked the mentioned example and got everything working...