Last post Nov 27, 2008 06:30 AM by etariq
Nov 26, 2008 04:44 PM|RudyK|LINK
Is there any clean way to retrieve the child records of a simple 1 -> M relationship and have those child records exposed as a Linq data source? My idea, is that i'm replacing the .NET data grid with a DevExpress ASPxGridView control, and dynamically creating
the detail grids based on the selected master grid item. The DevExpress control exposes the KeyValue, or the primary key value of the selected master record. So, in theory I could just call a "Where" clause and pass in that value.
The trick comes in the fact that Dynamic Data's structure is... well... dynamic enough that I'm not entirely even sure what table (or tables) will appear as the child of the master table. I can find the "child table" name by looping through the columns
until I get one with a TypeCode == Object, which represents the child items. I can't just straight out bind this column to anything, so it looks like the Meta - model just dead-ends here.
I would think there would be a way to retrieve these child records (because essentially, the .NET data grid does!) I just want them to be displayed in a different manner.
How do I set the child grid's data source dynamically to a table and foreign key field value?
Nov 27, 2008 06:26 AM|sjnaughton|LINK
Hi RudyK, have a look at these and see if they are the sort of thing you are trying to do:
Hope it helps you, I've not looked at the the DevExpress controls yet. [:D]
Custom Field Templates
Nov 27, 2008 06:30 AM|etariq|LINK
i have not used lina yet but hope this helps