nested grid clarification (blog post)

Posts   
 
    
Khuzema
User
Posts: 22
Joined: 24-Jul-2006
# Posted on: 11-Sep-2006 16:28:46   

Hi,

In your blog post http://weblogs.asp.net/fbouma/archive/2006/06/09/LLBLGen-Pro-v2.0-with-ASP.NET-2.0.aspx

you have mention example of nested repeater and the datasource you specified is 'OrderCollection' I dont know from where you are getting 'OrderCollection'. Can you kindly provide some info. My current webpage requires similiar scenerio.

thanks

Khuzema

Jessynoo avatar
Jessynoo
Support Team
Posts: 296
Joined: 19-Aug-2004
# Posted on: 11-Sep-2006 17:14:50   

Hi,

the ordercollection is the Customer's property based on the corresponding relation (you should have such collection property generated right?), and it is actually filled at query time for each customer from the datasource by the use of a prefetch path:

the corresponding code makes the trick:

PrefetchPath2 path = new PrefetchPath2((int)EntityType.CustomerEntity);
            path.Add(CustomerEntity.PrefetchPathOrderCollection, 5, null, null,
                    new SortExpression(OrderFields.OrderDate | SortOperator.Descending));
            _customerDS.PrefetchPathToUse = path;

Then you should have a look at the corresponding section in the manual to see how to deal with prefetch paths.

Cheers