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.
Unfortunately, activation email could not send to your email. Please try again.

How to implement a scene like the "NestedSummary2005" sample using GridGroupingControl

Thread ID:





72215 Mar 9,2008 10:28 PM Mar 27,2008 11:05 AM Windows Forms 2
Tags: GridControl
Asked On March 9, 2008 10:28 PM

I have a self-referential table with "ID","NAME","COST" and "FID" fields.The self-referential level isn't constant.The data_relation is between "ID" and "FID" fields.
1.How to make "ID","NAME","COST" columns as same width using TrackWidthOfParentColumn property in a loop code?
2.When a record at level n gets a child table and its "COST" field value changed event raises,how to set "COST" field value at level n-1 table as sum of "COST" field value at level n table,"COST" field value at level n-2 table as sum of "COST" field value at level n-1 table...so on.
3.When a record gets a child table,how to make it "readonly".


Administrator [Syncfusion]
Replied On March 17, 2008 11:12 AM

Hi Laoxu,

we are working on the forum.. we will update you soon.. Thanks for your interest in syncfusion products..


Administrator [Syncfusion]
Replied On March 27, 2008 11:05 AM

Hi laxou,

Issue 1: TrackWidthOfParentColumn

You can use the below code snippet to resolve this issue.

private void SetTrackWidthOfParentColumn( GridTableDescriptor descriptor)
if (descriptor == null) return;

foreach (GridRelationDescriptor relationDescriptor in descriptor.Relations)
for (int n = 0; n < relationDescriptor.ChildTableDescriptor.VisibleColumns.Count ; n++)
relationDescriptor.ChildTableDescriptor.Columns[n].TrackWidthOfParentColumn = relationDescriptor.ParentTableDescriptor.Columns[n].Name;

For call the above method, please use this


Issue 2: Sumarry

You need to add the SummaryRowDescriptor for each self relation table in a GroupingGrid. Below are the codes that shows you "How to add the Count summary for SelfRelation table in GroupingGrid?".

private GridRelationDescriptor AddManualRelations( GridTableDescriptor parentgridTableDescriptor )
GridRelationDescriptor parentToChildRelationDescriptor = new GridRelationDescriptor( );
parentToChildRelationDescriptor.ChildTableName = "SelfReferencingTable"; // same as SourceListSetEntry.Name for childTable (see below)
parentToChildRelationDescriptor.RelationKind = RelationKind.RelatedMasterDetails;
parentToChildRelationDescriptor.RelationKeys.Add( "DEPTNO", "ADMRDEBT" );

// Add relation to ParentTable
parentgridTableDescriptor.Relations.Add( parentToChildRelationDescriptor );
parentgridTableDescriptor.AllowNew = false;
parentgridTableDescriptor.AllowEdit = false;
GridSummaryColumnDescriptor totalSum = new GridSummaryColumnDescriptor("CumBuyQty");
totalSum.SummaryType = SummaryType.Count;
totalSum.Style = GridSummaryStyle.Column;
totalSum.DataMember = "DEPTNO";
totalSum.DisplayColumn = "DEPTNO";
totalSum.Format = "{Count:#}";

GridSummaryRowDescriptor sRow = new GridSummaryRowDescriptor("Totals", totalSum);
return parentToChildRelationDescriptor;

Issue 3: ReadOnly

You need to set the AllowEdit property of the TableDescriptor to true. Below are the codes:

parentgridTableDescriptor.Relations.Add( parentToChildRelationDescriptor );
parentgridTableDescriptor.AllowNew = false;
parentgridTableDescriptor.AllowEdit = false;


You can handle the CurrentCellStartingEditing event of the GroupingGrid and set the e.Inner.Cancel to TRUE for all parentable.

Please refer to the attached sample for implementation and let me know if this helps.

Best regards,


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.

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.