Summary column format

I have two summary rows and I am trying to set the format and text alignment of specific columns on the summary when the ggc load.

I am setting the format and text alignment when before I add the summary column to the summary row like below

WeeksSpotsSummaryColumn.Appearance.AnyRecordFieldCell.Format = "#,##0;($#,##0);";

row = new GridSummaryRowDescriptor("SummaryRow", WeeksSpotsSummaryColumn);
row.Visible = true;
this.gridGroupingControl.TableDescriptor.SummaryRows.Add(row);

this is not working? Please help

2 Replies

AD Administrator Syncfusion Team September 28, 2006 09:48 AM UTC

Hi James,

The GridSummaryColumnDescriptor.Format property used to format the text displayed in the summary column. A format string consists of the propertyname of the summaryType and the format specifier known form String.Format, e.g ({Average: ##.00}).

You can use the HorizontalAlignment property to align the text in summary cell. Below is a code snippet.

GridSummaryColumnDescriptor sd = new GridSummaryColumnDescriptor();
sd.DataMember= "Quantity";
sd.DisplayColumn = "Quantity";
sd.Format = "{Sum: #,##0;($#,##0)}";

sd.Appearance.AnySummaryCell.HorizontalAlignment = GridHorizontalAlignment.Center;
sd.SummaryType = SummaryType.DoubleAggregate;

this.gridGroupingControl1.TableDescriptor.SummaryRows.Add(new GridSummaryRowDescriptor("Quantity", "Sum :", sd));

Thanks,
Haneef


JA jamesb September 28, 2006 05:02 PM UTC

Thanks for your help

how else would i have know that these two are not the same...

sSpotsSummaryColumn.Appearance.AnyRecordFieldCell.Format = "#,##0;($#,##0);";

SummaryColumn..Format = "#,##0;($#,##0);";

Loader.
Up arrow icon