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

GGC: FlattenHierarchy Hides Expand/Collapse Buttons For ChildRows.

Thread ID:





55466 Jan 30,2007 07:43 PM UTC Jan 31,2007 07:24 PM UTC WinForms 1
Tags: GridControl
Eric Weinschenk
Asked On January 30, 2007 07:43 PM UTC


I've got a GGC bound to a list of parent objects: List.
Each Parent exposes a property of type List.
Each Child exposes a property of type List

As you would guess I want a grid that shows parents which expand to show children, which expand to show grandchildren.

I'm using RelationKind.UniformChildList:

GridRelationDescriptor children = new GridRelationDescriptor(relationName);
children.RelationKind = RelationKind.UniformChildList;
children.MappingName = propertyName;

This works great, and the relationships map fine.

The real problem is that I want to have two modes for my grid.

1: Where each "hierarchy level" has its own sets of columns and is indented. (This mode works fine)
2: Where every row of every level is shown with the exact same set of columns, such that all data from any level lines up perfect.

#2 can be accomplished by setting some properties like so:

childTable.TableOptions.ShowTableIndent = false;
childTable.TableOptions.ShowRowHeader = false;
childTable.TableOptions.ShowTableIndentAsCoveredRange = false;

Also, you need to catch column moving events and column resizing events and make sure the col setup remains consistent across all relationTableDescriptors.


Here's The Bug:

In "Flat Mode" the Expand/Collapse Button at the beginning of the row is missing for all but parent rows!!!

I think the problem is that some portion of the grid painting is drawing a big white box over it.

I've attached a screenshot comparing the two versions, filled with the same rows of data. You'll notice that on the right side, though expanded (through a call to ggc.ExpandAll() or something) the button is missing for all "Child" rows (Marked with a "C")
Any suggestions on how to fix this behavior?



Administrator [Syncfusion]
Replied On January 31, 2007 07:24 PM UTC

Hi Eric,

The reason is for disappearing the group caption plus minus cell is that you are setting the ShowTableIndent property to false. The ShowTableIndent property controls the width of the group caption plus minus cell, so you cannot set that to false and still get the +- button. But one way you can do this by handling the QueryCellStyleInfo event and set e.Style.CellType to "PushButton" for NestedTableIndentCell. If you want to implement the group caption plus minus cell like functionality, you need to handle the TableControlCellButtonClick event for expand/collaspe the childrecord. Here is a code snippet.

private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
if( e.TableCellIdentity.TableCellType == GridTableCellType.NestedTableIndentCell)
GridTable table = e.TableCellIdentity.Table;
if( table.TableDescriptor.Name == "ParentTable" )
e.Style.CellType = "PushButton";
e.Style.Description = "+";
e.Style.Enabled = true;

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.

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