Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Remove existing ItemCalculation with Particular ReferenceId from ListCalculator
posted

Hi,

Is it possible to remove ItemCalculation registered with ListCalculator ItemCalculations collection ?

Or at least change associated formula. When i try to replace formula i get exception  "InvalidOperationException: Collection Was Modified". 

Here is the sample which throws an exception

var calc = View.ListCalculator.ItemCalculations.FirstOrDefault(i => i.ReferenceId == FormulaId);

if (calc != null)

{

                calc.Formula = formula;

}

Please provide sample how to remove registration of the formula or replace formula in the already existing ItemCalculation.

 

Thanks.