Datagrid bands - related collections

Posts   
 
    
lwatson
User
Posts: 5
Joined: 13-Dec-2006
# Posted on: 19-Mar-2007 22:11:34   

Is there a way to limit the related collections that are returned after making a call to GetMulti from an instance of a collectionclass?

Here's an example:

Let's say we have a collection called Companies, that is related to Contacts, Orders, and Invoices.

When I bind this collection to my Infragistics DataGrid, I would only like one child band: Contacts. However, when I set MaxBandDepth to 2, there is a band for Contacts, Orders, and Invoices.

How can I get my grid to display Contacts as the only child band?

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 20-Mar-2007 07:55:25   

You are using SelfServicing, which have the LazyLoad feature, that loads related entities automatically when they are accessed by the code. To defuse this feature you should use prefetchPaths (load related entities in advance while loading the main entity/collection).

You can use a prefetchPath to Contacts, and use another prefetchPaths to other unwanted related entities with invalid filter. i.e. pass an impossible filter to the prefetchPaths of unwanted related entities. (eg. Id == -1)

lwatson
User
Posts: 5
Joined: 13-Dec-2006
# Posted on: 20-Mar-2007 14:53:53   

Bravo, thanks