I'm getting this error
This exception was originally thrown at this call stack: LokalPlanner.service.clsCalculateDiffMm.Name.get() in Summeries.cs Infragistics.Windows.DataPresenter.SummaryDefinitionCollection.GetMatchingSummaries.AnonymousMethod__0(Infragistics.Windows.DataPresenter.SummaryDefinition) Infragistics.Windows.DataPresenter.GridUtilities.Filter<T>(System.Collections.Generic.IEnumerable<T>, System.Predicate<T>) Infragistics.Windows.DataPresenter.SummaryCalculatorSelectionControl.GetApplicableSummaryCalculators(Infragistics.Windows.DataPresenter.Field) Infragistics.Windows.DataPresenter.SummaryCalculatorSelectionControl.UpdateSettings() System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs) System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs) System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs) System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex, System.Windows.DependencyProperty, System.Windows.PropertyMetadata, System.Windows.EffectiveValueEntry, ref System.Windows.EffectiveValueEntry, bool, bool, System.Windows.OperationType) System.Windows.StyleHelper.ApplyTemplatedParentValue(System.Windows.DependencyObject, MS.Internal.FrameworkObject, int, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord>, System.Windows.DependencyProperty, System.Windows.FrameworkElementFactory) ... [Call Stack Truncated]
SummaryDefinition MMDiff = new SummaryDefinition(); MMDiff.SourceFieldName = "MMDiff"; MMDiff.Calculator = new clsCalculateDiffMm(); MMDiff.Key = "Field1.1"; MMDiff.StringFormat = "{0:0.00}"; grid.FieldLayouts[0].SummaryDefinitions.Add(MMDiff);
public class clsCalculateDiffMm : Infragistics.Windows.DataPresenter.SummaryCalculator { private int mmGammel = 0; private int mmNy = 0;
public override string Description => throw new NotImplementedException();
public override string Name => throw new NotImplementedException();
public clsCalculateDiffMm() { }
public override void Aggregate(object dataValue, Infragistics.Windows.DataPresenter.SummaryResult summaryResult, Record record) { DataRecord dataRecord = (DataRecord)record;
mmGammel = int.Parse(dataRecord.Cells["MmÅrGammel"].Value.ToString()); mmNy = int.Parse(dataRecord.Cells["MmÅrNy"].Value.ToString()); }
public override void BeginCalculation(Infragistics.Windows.DataPresenter.SummaryResult summaryResult) { mmGammel = 0; mmNy = 0; }
public override bool CanProcessDataType(Type dataType) { throw new NotImplementedException(); }
public override object EndCalculation(Infragistics.Windows.DataPresenter.SummaryResult summaryResult) { double diff; diff = mmNy - mmGammel; return diff; } }
<igWPF:NumericField Label="Mm År Gammel" Name="MmÅrGammel" ></igWPF:NumericField> <igWPF:NumericField Label="% Mm Diff" Name="PrmMMDiff" ></igWPF:NumericField>
Hello Thomas,
Thank you for contacting Infragistics Developer Support.
From the call-stack you have provided, it sounds like this is likely a NotImplementedException coming from your custom summary not having a Name. I would recommend returning the string Name that you would like your summary to have, as this should prevent the exception you are receiving rather than throwing a NotImplementedException.
Please let me know if you have any other questions or concerns on this matter.