Easy bug to reproduce. I'm using the SaveCustomizations/LoadCustomizations API to serialize the grid state and reload it. Now I've added several custom summary calculators to my grid.
When I Load the state of the grid all of the fields with custom summaries now are using the "Sum" summary calculator instead of the custom one.
I examined the xml output by the SaveCustomizations API and it is serializing the Calculator as "Sum" which is obviously not correct.
This bug makes it impossible to use both features simulataneously.
<
igDP:FieldLayout.SummaryDefinitions>
<igDP:SummaryDefinition SourceFieldName="Oface"
Calculator="{x:Static local:TBAShorts.SelectedSum}"
StringFormat="{}{0:#,#;;0}"/>
<igDP:SummaryDefinition SourceFieldName="Qty"
StringFormat="{}{0:#,#.##;;0}"/>
<igDP:SummaryDefinition SourceFieldName="MTG_WACPN"
Calculator="{x:Static local:TBAShorts.SelectedAverage}"
StringFormat="{}{0:0.##}"/>
<igDP:SummaryDefinition SourceFieldName="MTG_WAM"
<igDP:SummaryDefinition SourceFieldName="MTG_WAOLTV"
</
ouput of SaveCustomizations():
<summaries> <SummaryDefinition SourceFieldName="Oface" StringFormat="{0:#,#;;0}" Calculator="Sum" /> <SummaryDefinition SourceFieldName="Qty" StringFormat="{0:#,#.##;;0}" Calculator="Sum" /> <SummaryDefinition SourceFieldName="MTG_WACPN" StringFormat="{0:0.##}" Calculator="Sum" /> <SummaryDefinition SourceFieldName="MTG_WAM" StringFormat="{0:0.##}" Calculator="Sum" /> <SummaryDefinition SourceFieldName="MTG_WAOLTV" StringFormat="{0:0.##}" Calculator="Sum" />
</summaries>
My custom calculators, which derive from SumSummaryCalculator
SumSummaryCalculator
{
record)
)
)record).DataItem;
(item.IsSelected)
)dataValue * item.Weight, summaryResult, record);
}
.Aggregate(dataValue, summaryResult, record);
Hi, I tweaked your example to more closely reflect how I'm using it. When you click on Save the xml looks good, but when you click on Load to invoke LoadCustomizations it blows away the summary.
Hello,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Thank you for your post. I have been looking into it and the code you have provided and I created a sample project for you and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.