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

Nested Child-Collection example in dashboard. How to add nested child table programmatically?

Thread ID:





124218 May 25,2016 02:15 AM UTC May 25,2016 02:36 PM UTC WinForms 1
Tags: GridGroupingControl
Paul Chung
Asked On May 25, 2016 02:15 AM UTC


I am using the GridGroupingControl that works similar as the Nested Child-Collection example in the winform dashboard.

I couldn't find a way to programmatically add a child table after the data source is bound.

Here is my example modification from the "Nested Child-Collection example",

First I modify the BaseClassList to BindingList so that it supports update

public class BaseClassList : BindingList<BaseClass>, ITypedList

In the Form1 constructor, after 

            _gridGroupingControl1.DataSource = theList;

I added these to just test programmatically changing the list.

            Action mystuff = () =>
                var list = new BaseClassList();
                for (int i = 0; i < 5; i++)
                    list.Add(new SecondClass(theList[0], i, "myItem" + i));
                theList[0].ChildTables.Add("XXXXChild_Of_List0", list);

            Thread tt = new Thread(() => {

There is no effect after few seconds. 
I also tried unbind the data source and bind it again it still doesn't work.

Adhikesevan Kothandaraman [Syncfusion]
Replied On May 25, 2016 02:36 PM UTC

Hi Paul, 

Thanks for using Syncfusion products. 

If you want to add the additional child table on runtime, please reset the Datasource of the GridGroupingControl and then set the updated source to the grid. Please refer to the following code snippet, 

Code Snippet: 
var list = new BaseClassList(); 
for (int i = 0; i < 5; i++) 
    list.Add(new SecondClass(theList[0], i, "myItem" + i)); 
theList[0].ChildTables.Add("NewChild", list); 
this.gridGroupingControl1.DataSource = null; 
//Set the updated source to the Grid 
this.gridGroupingControl1.DataSource = theList; 
Sample Link: 



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