I have an object model defined using Open Access. The object has a collection of child objects.
I want to:
- display my objects in a grid
- display the objects in the child collection in a details grid.
- use the fact that OA is prefetching the child data for me to populate the child grids.
Items 1 and 2 are straightforward, I've created the grid and created a child grid. It's 3 that's causing me the problem.
All of the examples I've seen to use 2 separate fetches, usually via SQL to populate the grids; the first for the master table the 2nd for the child grid.
What I hoped to do was get the DetailTableDataBind event to fire for each row in the master table view that was bound, access the parent item and set the data source of the detail table to the collection of child objects.
Sadly this won't work (prolly 'cos I'm doing it wrong).
I've set the detail table up using this ...
And from what I read in the docs, I expected this to cause the DetailTableDataBind to fire after the ItemDataBound event for each item in the MasterTableView. It doesn't. In fact it doesn't fire 'til the master table's row is expanded.
The next problem is that when the DetailTableDataBind event fires I can't get at the parent row's data object, this is, I assume, 'cos it's only available when the ItemDataBound event for that row fires.
So, just how much of what I've read in the docs have I failed to understand?
And is it actually possible to bind a DetailTableView to the child objects of an object without going to the data store a 2nd time?