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/Collapse GGC

Thread ID:

Created:

Updated:

Platform:

Replies:

69443 Oct 27,2007 08:28 PM Nov 1,2007 02:14 AM Windows Forms 3
loading
Tags: Grouping
Ravi
Asked On October 27, 2007 08:28 PM

Hi,

Iam using Hierarchical Grid grouping control with the datasource as dataset and my dataset contains three related tables. Iam not using any grouped columns. I want to expand, collapse GGC based on the table level. I want add three buttons called "Parent", "Child", "GrandChild". If i click "Parent" button i want to display entries in parent table(first table entries). If i click "Child" button, i want to display parent, child table entries. If i click "GrandChild" button i want to expand all entries of all the tables.

GridGroupingControl.Table.CollapseAllRecords();
GridGroupingControl.Table.CollapseAllGroups();
GridGroupingControl.Table.ExpandAllGroups();
GridGroupingControl.Table.ExpandAllRecords();

Above methods solve my requirement when i click "Parent" and "GrandChild" button, but how do i expand first level and second level table entries only( hiding third level table entries).

Thanks,
-Ravi.

Jeba S [Syncfusion]
Replied On October 29, 2007 02:06 AM

Hi Ravi,

Thank you for posting query to us.

You can loop through the records of the parent table and make the ChildTable expanded. Then loop through the records of the ChildTable and make the GrandChildTable collpased.

Please refer this code snippets:

this.gridGroupingControl1.Table.ExpandAllRecords();
foreach (Record r in this.gridGroupingControl1.Table.Records)
{
if (r != null)
{
r.NestedTables["ChildTable"].IsExpanded = true;
foreach (Record rec in r.NestedTables["ChildTable"].Records)
{
if (rec != null)
{
rec.NestedTables["GrandChildTable"].IsExpanded = false;
}
}
}
}


Please refer the sample which implements the above said feature:
http://websamples.syncfusion.com/samples/Grid.Windows/F69443/main.htm

Kindly let us know if you need any further assistance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

Ravi
Replied On October 29, 2007 09:30 AM

Hi Jeba,

Thanks for your reply, Your sample does not work when i add following code in Form load event.

this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false;
this.gridGroupingControl1.NestedTableGroupOptions.ShowCaptionPlusMinus = false;
this.gridGroupingControl1.NestedTableGroupOptions.ShowCaption = false;
this.gridGroupingControl1.ChildGroupOptions.ShowCaptionPlusMinus = false;

I need above code to hide caption titles. Please help me to fix the problem.

Thanks,
-Ravi.

Jeba S [Syncfusion]
Replied On November 1, 2007 02:14 AM

Hi Ravi,

PlusMinus button in the caption row maintains the Expand/Collpase State of the child Table. If you hide the PlusMinus button either through property ShowCaptionPlusMinus or ShowCaption then the IsExpanded has no effect on the child tables.


this.gridGroupingControl1.NestedTableGroupOptions.ShowCaptionPlusMinus = false;
this.gridGroupingControl1NestedTableGroupOptions.ShowCaption = false;


If you hide the caption row then all the tables are in expanded state. This is the default behaviour. We cannot change this default behaviour.

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.



CONFIRMATION

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.

;