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.

Expand and collapse nested table in gridGroupingControl

Thread ID:





35318 Sep 28,2005 04:49 AM Sep 28,2005 10:43 AM Windows Forms 3
Tags: GridControl
Prathima Venkobachar
Asked On September 28, 2005 04:49 AM

Hi, I am using GGC with nested tables. I want to expand/collapse nested table records on button click. What is property to do the same..? Thanks, Prathima

Administrator [Syncfusion]
Replied On September 28, 2005 06:38 AM

Hi Prathima You can use the following code to expand and collapse the nested table records. To Expand this.gridGroupingControl1.Table.ExpandAllRecords(); To Collapse this.gridGroupingControl1.Table.CollapseAllRecords(); To Expand a selected record this.gridGroupingControl1.Table.SelectedRecords[0].Record.IsExpanded = true; Best Regards Mouli.

Prathima Venkobachar
Replied On September 28, 2005 07:38 AM

Thanks for the reply.It works fine. I have one more problem, If my grid has only grouping and no nested table..then also on click of this button it expands all the groups. So I want to make a check if the grid has nested table then only it should expand all records.How can I do this check..? I tried with HasChildren property..it is returning true even though the grid doesn''t have any nested table. Thanks, Prathima

Administrator [Syncfusion]
Replied On September 28, 2005 10:43 AM

Hi Prathima , I think that you have grouped the main table and the main table has got nested table. The following code checks if the each record in each group has got records of nested table. If so it expands the group as well as the nested table records for each group. foreach(Group g in this.gridGroupingControl1.Table.TopLevelGroup.Groups) foreach(Record r in g.Records) if( r.NestedTables[0].ChildTable.Records.Count > 0) g.IsExpanded = true; r.IsExpanded = true; } Best Regards Mouli


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.