If a grid is bound to a custom object collection (not a dataset), is there any way for a detailgrid within that grid to retrieve the object that belongs to the parent row?
For example,
I have a collection of customer objects. Each customer object has a collection of invoices:
cust1
– inv1
– inv2
cust2
– inv1
– inv2
cust3
– inv1
I can bind the customer object collection to a grid and it all works fine (just by setting the grid’s DataSource property to the customer collection object).
I then want to add a detail grid which when expanded binds to the invoices collection for that customer.
When I expand cust2, for example, what’s the best way to access the invoice collection for cust2? It would be ideal if there was some way to access the ‘cust’ object directly. Or can I get the index of the collection reference and then reference the DataSource on the parent grid to get the cust object?
Thanks,
Jamie.
Imported from legacy forums. Posted by Jamie (had 2049 views)