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.
Syncfusion Feedback

Hide caption Summary Row on expand collapse

Thread ID:

Created:

Updated:

Platform:

Replies:

54917 Jan 19,2007 02:53 PM UTC Jan 22,2007 05:49 PM UTC Windows Forms 5
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 19, 2007 02:53 PM UTC

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 03:51 PM UTC

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 04:06 PM UTC

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 05:30 PM UTC

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 12:45 PM UTC

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 05:49 PM UTC

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.

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

;