We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GGC master/child with LINQ


Why it doesn't worK?
I see only the parent row, not the child

It worked fine with dataset / datatable



Private db As New DataClasses1DataContext

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim parentQry = From parent In db.Customers _
Select parent.CustomerID, parent.CustomerName
Dim childQry = From child In db.Orders _
Select child.CustomerID, child.OrderDate, child.OrderID


Dim parentToChildRelationDescriptor As New GridRelationDescriptor()
parentToChildRelationDescriptor.ChildTableName = "MyChildTable" '
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails
parentToChildRelationDescriptor.RelationKeys.Add("CustomerID", "CustomerID")

gridGroupingControl1.TableDescriptor.Relations.Add(parentToChildRelationDescriptor)
Me.GridGroupingControl1.Engine.SourceListSet.Add("MyParentTable", parentQry)
Me.GridGroupingControl1.Engine.SourceListSet.Add("MyChildTable", childqry)

Me.GridGroupingControl1.DataSource = parentQry

End Sub 'Form1_Load



1 Reply

SR SubhaSheela R Syncfusion Team September 22, 2008 06:14 AM UTC

Hi Gabi,

Thanks for your interest in Syncfusion products.

You can refer our shipped browser sample that allows the user to build data relations, such as ListItemReference, MasterDetail and Many to Many, using linq queries.

Here is the path:

\\MyDocuments\Syncfusion\EssentialStudio\6.3.0.25\Windows\Grid.Grouping.Windows\Samples\2.0\FeaturedSamples\LINQToSQLSample

Please let me know if you have any queries.

Regards,
Subhasheela R


Loader.
Live Chat Icon For mobile
Up arrow icon