I have created a custom row summary calculator but do not know how to attach it to a field in the xamDataGrid. I build it and register it in code and then reference it in the xaml as follows:
<igDP:SummaryDefinition
StringFormat=" {0:#,##0.00;(#,##0.00);0.0}"
Key="WorkUnitLaborMult"
SourceFieldName="WorkUnitLaborMult"
Calculator="ProjectEffectiveMult" Position="UseSummaryPositionField"/>
The summary comes up blank when the grid is displayed. Using the debugger I can tell it is not running through the custom calculation class code.
Thank you for your help.
So I figured out that once I register the SummaryCalculator by running through the code that registers, it does not display a value during this first processing. If I exit back to the Project Selection and select the project again, the summary calculation is performed because I did not UnRegister the calculator.
I thought I would prgrammatically set the SummaryCalculator, after registering it, using SummaryCalculator.RegisteredCalculators, so it would be available immediately. However I could not find a way to get a reference to any specific Registered Summary Calculator no less the summary calculator I registered.
The example in the documentation makes it available to be selected but I can't let the users choose the calculations for specific fields I want to set them in xaml or using code. I am going to have to do more of these so some help would be nice.
Thank You.
I did two things in the source code the last time I did this.
1. Register the calculator:
SummaryCalculator.Register(new MyCalculatorClass());
2. Create a property for the calculator.
public static MyCalculatorClass MyCalculatorProperty { get { if (null == _classObject) _classObject= new MyCalculatorClass();
return _classObject; } }
3. In the XAML, I bound the summary field to the property name MyCalculatorProperty, not the class name of the calculator.
There may be other ways of doing this, but that is how I did it.