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

Create/Edit hierarchical data in Grid - Help

Thread ID:





77551 Nov 5,2008 07:18 PM UTC Nov 17,2008 06:32 AM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On November 5, 2008 07:18 PM UTC


Is possible create hierarchical data in Grid without one data collection loaded for levels (parents and childs), only with code? How?
My application need create/edit the hierarchical data in runtime, like select one cell (first column) in Grid and click in "Expand Selected column" (like Excel).

Thanks for all help.

For example, see my attached image.


Nisha Arockiya A [Syncfusion]
Replied On November 11, 2008 11:09 AM UTC

Hi Rossa,

Thanks for your interest in Syncfusion Products.

Hierarchical Data can be created by defining relation between Parent and Child Datatable.Please refer to the code snippet below.

DataTable parentTable = GetParentTable();
DataTable childTable = GetChildTable();
DataSet ds = new DataSet();
ds.Tables.AddRange(new DataTable[] { parentTable, childTable });
ds.Relations.Add(new DataRelation("ParentToChild", ds.Tables[0].Columns["parentID"], ds.Tables[1].Columns["ParentID"]));
this.gridGroupingControl1.DataSource = parentTable;

Here is a minimal sample:

Please let me know if this is your requirement or am I missing any thing??


Administrator [Syncfusion]
Replied On November 11, 2008 11:44 AM UTC

Hi Nisha,

Thanks for you reply, in my case I need create (layout) hierarchical data in runtime (virtual mode), where all "relations" (only layout) are created on demand.
Why? My collection not contain relations with data fields, not contain data fields keys, only has relation "parent-childs" defined on demand.
I found in Syncfusion Samples (.Net Win Forms) the application "VirtTree Grid", it's basically I need.

I codified some applications like this sample found, I write my questions in soon.


Nisha Arockiya A [Syncfusion]
Replied On November 17, 2008 06:32 AM UTC

Hi Rossa,

Thanks for the updates.

We are waiting to hear from you.



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

or the page will be automatically redirected to 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