private static Field AddFieldAndSummary(DataColumn col, FieldLength?width, IFValueComparer comparer, bool useMeasureModule, bool isCumulateDrums, SummaryCalculator statType, string stringFormat, out SummaryDefinition summaryDefinition, Style fValueStyle) { var fld = AddFValueField(col.ColumnName, col.DataType, width, fValueStyle, _comparer); if (!isCumulateDrums) { summaryDefinition = new FValueSummaryDefinition { SourceFieldName = fld.Name, Calculator = statType, StringFormat = stringFormat, UseMeasureModule = useMeasureModule, }; //fieldLayout.SummaryDefinitions.Add(sd); } else { summaryDefinition = null; } return(fld); }
private void dg1_FieldLayoutInitialized(object sender, Infragistics.Windows.DataPresenter.Events.FieldLayoutInitializedEventArgs e) { foreach (Field f in dg1.FieldLayouts[0].Fields) { SummaryDefinition sum = new SummaryDefinition(); sum.SourceFieldName = f.Name; sum.Calculator = SummaryCalculator.Sum; sum.StringFormat = "{0:c}"; this.dg1.FieldLayouts[0].SummaryDefinitions.Add(sum); } }