Displyaing the record unique column values in Summary

Hi ,

I am using the GridgroupingControl to display the output of my Custom collection. Can you please let me know on how to display the unique column values in summary Cells .

For eg I have 4 records

ID NAME, TYPE, VAL1, VAL2

12 ABC C 2 3
12 ABC C 3 4
13 EFG D 10 20
13 EFG D 20 30

I am grouping this by Id

So I want this to be displayed like below with alternate records of this group having different colors ( not rows in this group ).

+ 12 ABC C 5 7
+ 13 EFG D 30 50

I know how to display the ID, sum of VAL1 and VAL2. Appreciate if you can give any guidance on this.

Thanks,
Sofia

1 Reply

HA haneefm Syncfusion Team June 29, 2007 11:38 PM UTC

Hi Soffia,

The "Summaries For NestedTables And Groups" sample demonstrates the adding of Summaries through code. The summaries that are set for the top table are sufficient enough to create summaries in groups.

For creating summaries through code, create an instance of the GridSummaryColumnDescriptor specifying the summarytype, summarycolumn and formattype. Then create an instance of the GridSummaryRowDescriptor by passing the GridSummaryColumnDescriptor object. The GridSummaryRowDescriptor object can be added to the GridSummaryRowDescriptorCollection for the required table.

// Adding Summaries for the Details Table.
GridSummaryColumnDescriptor scd = new GridSummaryColumnDescriptor("Sum", SummaryType.Int32Aggregate, "Quantity", "{Sum:#}");
GridSummaryRowDescriptor srd = new GridSummaryRowDescriptor("Sum","Total", scd);
srd.Appearance.AnyCell.HorizontalAlignment = GridHorizontalAlignment.Right;
srd.Appearance.AnyCell.BackColor = SystemColors.Info;
this.gridGroupingControl1.GetTableDescriptor("Order Details").SummaryRows.Add(srd);

Sample : SummariesForNestedTablesAndGroups.zip

Also refer the Appearance category samples for more details.
C:\Documents and Settings\haneefm\My Documents\Syncfusion\EssentialStudio\5.1.1.0\Windows\Grid.Grouping.Windows\Samples\2.0\Appearance\StylesAtGroupLevel\cs

Best regards,
Haneef

Loader.
Up arrow icon