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.

Hide caption Summary Row on expand collapse

Thread ID:

Created:

Updated:

Platform:

Replies:

54917 Jan 19,2007 09:53 AM Jan 22,2007 12:49 PM Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 19, 2007 09:53 AM

Hi,

How to toggle visible property of the gridgrouping control on Groupexpand/Collapse event. I want to hide the summarycaptionrow of the group when expand.

Thanks
Harshad

Administrator [Syncfusion]
Replied On January 19, 2007 10:51 AM

Hi Harshad,

Use ShowCaptionSummaryCells property to hide/show the Caption summary row in a grid. Here is a code snippet

//To hide the main table Captionsummary row.
this.gridGroupingControl1.TopLevelGroupOptions.ShowCaptionSummaryCells = false;

//To hide the nested table Captionsummary row.
this.gridGroupingControl1.NestedTableGroupOptions.ShowCaptionSummaryCells = false;

//To hide all groups Captionsummary row.
this.gridGroupingControl1.ChildGroupOptions.ShowCaptionSummaryCells = false;

//To hide a particular grouped column Captionsummary row.
this.gridGroupingControl1.TableDescriptor.Columns[ GroupByField ].GroupByOptions.ShowCaptionSummaryCells = false;

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 19, 2007 11:06 AM

Actually I want to hide the summary for the group row which is expanded.
i.e If i have 2 group values and I expanded first group row then only caption summary row of that group section should be hidden. while second group value(for same group column)which is still collapsed should be visible

Administrator [Syncfusion]
Replied On January 19, 2007 12:30 PM

Hi Harshad,

You would have to derive a class from GridGroup. In your derived classes you need to override IsChildVisible.

Something like this:

public override bool IsChildVisible(Element el)
{
if (el is CaptionSection && this.IsExpanded )
return false;
else
return base.IsChildVisible(el);// Otherwise default behavior:
}

Here is a minimal sample that shows how to hide the expanded group caption summary row in a grid.
GGCHideshowSummaries.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 22, 2007 07:45 AM

Hi,

Thanks for the details....now i am close to what i am expecting grid should behave.

In the example given by you, IT removed caption bar totally....I dont want to remove the caption text i.e grouping element with +/- . I just want to clear summary columns next to the caption text for that grouping value.

Please look into this . Your help is highly appriciated

Thanks

Administrator [Syncfusion]
Replied On January 22, 2007 12:49 PM

Hi Harshed,

You can handle the TableModel.QueryCoveredRange event and set the e.Range for expanded groupcaption cell. Here is a code snippet.

private void TableModel_QueryCoveredRange(object sender, GridQueryCoveredRangeEventArgs e)
{
GridTableModel model = sender as GridTableModel;
Element el = model.Table.DisplayElements[e.RowIndex];

if( el.ParentGroup != null && el.ParentGroup.IsExpanded )
{
GridTableCellStyleInfo style = model[e.RowIndex,e.ColIndex] as GridTableCellStyleInfo;
if( style != null
&& style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell )
{
e.Range = GridRangeInfo.Cells(e.RowIndex,e.ColIndex,e.RowIndex,model.ColCount);
e.Handled = true;
}
}
}


Please refer to the attached sample for implementation.
GGCHideshowSummaries.zip

Best Regards,
Haneef

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.

;