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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to bind to a simple class with properties of List<T> for the child relations

Thread ID:





130624 May 22,2017 09:08 PM UTC May 23,2017 09:57 AM UTC WinForms 1
Tags: GridGroupingControl
David Adkins
Asked On May 22, 2017 09:08 PM UTC

I'm sorry if I'm missing a tutorial. I'm evaluating the GridGroupingControl. I have a class with public properties that I'm setting the DataSource of the grid to a List<T> for that class type. It works but now I'm trying create a relation that would expand a row and show another grid of a different class. The children of a row are a public property of List<T> for the childtype class. It is having a runtime error of   Message=Possible incorrect RelationDescriptor.ChildTableName for Relation relCauses.
Engine.SourceListSet[Causes] returned null.
Did you forget to call Engine.SourceListSet.Add(new SourceListSetEntry(Causes, list)
or did you specify a wrong ChildTableName?

Any advice or a simple demo of Parent/Children/Grandchildren using simple .NET bare bones classes with properties of List<T> for the children?

Arulpriya Ramalingam [Syncfusion]
Replied On May 23, 2017 09:57 AM UTC

Hi David, 

Thanks for your interest in Syncfusion products. 

Did you forget to call Engine.SourceListSet.Add(new SourceListSetEntry(Causes, list) 
or did you specify a wrong ChildTableName? 
We have created a simple sample as per your requirement. The relational child table can be added to a parent table in GridGroupingControl by adding the childTable to Engine.SourceListSet. The childTable name should be registered with Engine.SourceListSet, so that the RelationDescriptor can get the child table name. Please make use of below code and samples, 
//Assigning Data source to Grid 
gridGroupingControl1.DataSource = parentTable; 
//Registering the child table with SourceListSet 
//Adding Foreignkey reference to grid 
GridRelationDescriptor relation = new GridRelationDescriptor(); 
relation.RelationKind = RelationKind.RelatedMasterDetails; 
relation.ChildTableName = "ChildTable"; 
relation.RelationKeys.Add("CategoryID", "CategoryID"); 
relation.ChildTableDescriptor.AllowEdit = true; 
Already we have provided the information in our user guide document. Please refer to the below link, 

Any advice or a simple demo of Parent/Children/Grandchildren using simple .NET bare bones classes with properties of List<T> for the children? 
We have provided the dash board samples with parent/child/grandchild table relations. Please refer the below samples, 
Dash Board sample link:  
<InstallLocation> \Syncfusion\EssentialStudio\<Product Version>\Windows\Grid.Grouping.Windows\Samples\Data Sources\Nested Child-Collection Demo\ 

<InstallLocation>\Syncfusion\EssentialStudio\<Product version>\Windows\Grid.Grouping.Windows\Samples\Relation And Hierarchy\Related Master Details Demo 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon