DynamicList with child DynamicList

Posts   
 
    
G.I.
User
Posts: 172
Joined: 09-Jun-2005
# Posted on: 11-Jul-2005 14:42:27   

Hi,

maybe there is a better solution for this, if so please tell me...

I am using a Infragistics Grid. I am trying to get a hierachical datagrid, which means that each row can have a couple of child rows.

This means that I have to define a relation somehow between two datatables in this case.

So I use a dynamicList to create the first datatable, that works ok, now I need to create a second datatable. How do I do this?

Each row in the first table has an ObjNo, which is needed for the relation to the second datatable. How do I create the next dynamicList using the objNo's from the first database and how do I create this relation then?

Is there a way to create this another way?

Plz help, thanks in advance,

G.I.

jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 11-Jul-2005 17:44:57   

G.I. wrote:

Hi,

maybe there is a better solution for this, if so please tell me...

I am using a Infragistics Grid. I am trying to get a hierachical datagrid, which means that each row can have a couple of child rows.

This means that I have to define a relation somehow between two datatables in this case.

So I use a dynamicList to create the first datatable, that works ok, now I need to create a second datatable. How do I do this?

Each row in the first table has an ObjNo, which is needed for the relation to the second datatable. How do I create the next dynamicList using the objNo's from the first database and how do I create this relation then?

Is there a way to create this another way?

Plz help, thanks in advance,

G.I.

Hi, there. Try creating another dynamic list for all of the child rows, then manually add both to a new dataset, create the relationship there, then bind the dataset to the grid.

Jeff...

Nad
User
Posts: 3
Joined: 14-Jul-2005
# Posted on: 14-Jul-2005 15:26:48   

Can a LLBLGen Pro Developer can confirm that the only way to have multi-band data collection in an Infragistics Grid is to use a DataSet. Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Jul-2005 15:29:34   

No, you can have multi-band hierarchies using entitycollections as well. For example, bind a collection of Customers to the grid, and for each customer you'll be able to click open its Orders collection, and if each Order has an OrderDetails collection, you can click that open as well.

Frans Bouma | Lead developer LLBLGen Pro
Nad
User
Posts: 3
Joined: 14-Jul-2005
# Posted on: 14-Jul-2005 16:39:34   

Can you show me a simple example of how to retrieve data where the parent table is a EntityCollection (full retrieve) having many child?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Jul-2005 18:58:59   

Nad wrote:

Can you show me a simple example of how to retrieve data where the parent table is a EntityCollection (full retrieve) having many child?


IPrefetchPath2 path = new PrefetchPath2((int)EntityType.CustomerEntity);
EntityCollection customers = new EntityCollection(new CustomerEntityFactory());
IPrefetchPathElement pathElement = path.Add(CustomerEntity.PrefetchPathOrders);
pathElement.SubPath.Add(OrderEntity.PrefetchPathOrderDetails);
pathElement.SubPath.Add(OrderEntity.PrefetchPathProducts);

adapter.FetchEntityCollection(customers, null, path);
theGrid.DataSource = customers;

fetches all customers, every customer's orders, per order all order details and per order the m:n related products.

See also 'Prefetch paths' in the documentation for more details about this.

Frans Bouma | Lead developer LLBLGen Pro
Nad
User
Posts: 3
Joined: 14-Jul-2005
# Posted on: 14-Jul-2005 19:41:09   

Youppi!!!!!! It works. Thank you smile