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. Image for the cookie policy date
close icon

Grid Grouping Control Summary

How would you make the summary row match the group header?

3 Replies

AD Administrator Syncfusion Team November 16, 2005 07:26 PM UTC

I am not sure I understand. By group header, do you mean the group caption row? If so, ar e you showing summarycells in this caption row,and what you want is the summary rows under the group have the same size columns as the caption summaries? Or, do you just want the coloring of the summary row to be the same as the coloring of the caption row? Or something else?


AD Administrator Syncfusion Team November 16, 2005 08:06 PM UTC

Sorry I was a little vague. Basically I am setting the text of the group caption row using the following code and I just want the same text to show up in the summary row. This is from the QueryCellStyleInfo event where the the tablecelltype is GroupCaptionCell GridCaptionRow gcr = e.TableCellIdentity.DisplayElement as GridCaptionRow; GridCaptionSection gcs = gcr.ParentSection as GridCaptionSection; Record rFirst = gcs.ParentGroup.GetFirstRecord(); int nFirst = e.TableCellIdentity.Table.FilteredRecords.IndexOf(rFirst) + 1; int nLast = nFirst + gcs.ParentGroup.GetChildCount() - 1; e.Style.Text = string.Format("{0}, Rows: {1}-{2}", rFirst.GetValue("group_name"), nFirst, nLast);


AD Administrator Syncfusion Team November 16, 2005 11:26 PM UTC

You can try code like:
if(e.TableCellIdentity.TableCellType == GridTableCellType.SummaryEmptyCell 
	&& e.TableCellIdentity.ColIndex == e.TableCellIdentity.DisplayElement.GroupLevel + 1)
{
	GridSummaryRow gcr = e.TableCellIdentity.DisplayElement as GridSummaryRow;
	GridSummarySection gcs = gcr.ParentSection as GridSummarySection;
	Record rFirst = gcs.ParentGroup.GetFirstRecord();
	int nFirst = e.TableCellIdentity.Table.FilteredRecords.IndexOf(rFirst) + 1;
	int nLast = nFirst + gcs.ParentGroup.GetChildCount() - 1;
	e.Style.Text = string.Format("{0}, Rows: {1}-{2}", rFirst.GetValue("Col1"), nFirst, nLast);
}
Here is a little sample. http://www.syncfusion.com/Support/user/uploads/GGC_CustomEngine_515ff464.zip

Loader.
Live Chat Icon For mobile
Up arrow icon