This is a migrated thread and some comments may be shown as answers.

Grouping child entities in grid view

1 Answer 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 2
Bob asked on 16 May 2012, 07:47 PM
Hi there -

I'm new to Entity Framework and still working my way through the gridview control.  I'm not sure where to put this question, so I figured I would start here.

I have an entity framework (EF) with a header-detail model.  When I perform the linq query with an include, I want to display the sub entities (the details) in the grid.  Would be even nicer if I group group by the details (all in one grid).

So my questions may be, how do I write/use the linq query to bring back the headers and group the details within the same grid.  Here is what I have so far:
Private Sub loadLotDetails(PO_Number As String)
    Dim query = From l In context.Lot_Header.Include("Lot_Detail")
                Where l.Lot_Number = PO_Number And l.Lot_Process_Status <> "90"
                Select l
 
    lotDetailsGridView.DataSource = query
End Sub

I appreciate any information or direction possible.

Thanks
Bob



1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 21 May 2012, 04:08 PM
Hi Bob,

Thank you for writing.

You can read this article in our online documentation where you will find this functionality implemented.

I hope this helps. Let me know if you need further assistance.

Greetings,
Julian Benkov
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
Bob
Top achievements
Rank 2
Answers by
Julian Benkov
Telerik team
Share this question
or