Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

A master-detail grid with Entity Framework objects

$
0
0

Starting with version 2012 vol 1, it is possible to enable the master-detail feature for collection properties generated by Entity Framework. See the Use Master-detail views with generic collections of type IList<T> and IEnumerable thread for details.

This example demonstrates how to bind related entities to the XtraGrid and display them in master-detail views.

See also:How to display Entity Framework objects in a grid within master-detail mode when entities have many-to-many relationship and a linked table is included to an entity model

Question Comments

Added By: Josh Soriano at: 8/16/2013 5:53:31 PM    

my problem is im using EF5 which preferred using DbSet instead of ObjectQuery, and how can i add a row in child grid...

Added By: Hassan Gulzar at: 2/1/2015 5:30:13 AM    

Same issue here as Josh said above. EF5 and onwards, the line gridControl1.DataSource = new BindingSource(customersQuery, ""); becomes invalid as customersQuery needs to have a .ToList() and that defeats the purpose because 1) I cannot have the CRUD ops auto reflect on the context 2) I cannot have one save button to submit all the changes.


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>