Formating in the Cell

Hi,
I am using GGC and need to format the content of the cell.it is having summary cell as well and I need to format summary content as well

ex; if Cellvalue is 234567.580 I need to format it as 234567.58 or 234567.6 rounded off

could you pls help.if possible some code exemple would be highly appreciated

thanks,
Ejaz

1 Reply

HA haneefm Syncfusion Team May 4, 2007 03:14 PM UTC

Hi,

The GridSummaryColumnDescriptor.Format string used to format the text to display in the summary column. A format string consists of the PropertyName of the summaryType and a format specifier known from String.Format, e.g. {Average:###.00}. Colud you try this code

//SummaryCell description in a grid.
GridSummaryColumnDescriptor sd = new GridSummaryColumnDescriptor();
sd.DataMember= "DataColumName";
sd.DisplayColumn = "DisplayColumnName";
sd.Format = "{Sum:F1}";
sd.SummaryType = SummaryType.DoubleAggregate;

//Adding SummaryCell in a grid.
this.gridGroupingControl1.TableDescriptor.SummaryRows.Add(new GridSummaryRowDescriptor("Col2", "Sum", sd));

Best Regards,
Haneef

Loader.
Up arrow icon