I have a form with ultracalcManager and many ultranumericeditors.When I use a control in the formula that is bounded with dataset everything works, But if in the formula is present a control that is calculated himself, the value read is zero. Example:
NumericEditor_1 Bounded to DataSet
NumericEditor_2 Bounded to Dataset
NumericEditor_3 Use UltraCalcManager to SUM the NumericEditor_1 + NumericEditor_2 Working Good
NumericEditor_4 Bounded to Datase
NumericEditor_5 Use UltracalcaManager to SUM NumericEditor_3 + NumericEditor_4 The result is that NumericEditor_3 is ALWAYS ZERO
and the result of the SUM is only NumericEditor_4
Why ?
Hi Paolo,
Thank you for posting to Infragistics Community!
I have been looking into your question and created a test application with several UltraNumericEditors and corresponding formula settings witht the help of the UltraCalcManager, as described by you.
To setup the CalcSettings for the editors, I have followed the approach from this topic of our documentation.
On my side, I am currently not able to reproduce any errors and all calculations are executed as expected. Please, check out the below gif, as well as please run and test the below attached sample on your side as well:
Having in mind that the isolated sample shows this scenario working as expected, it is possible that the observed is due to some local misconfiguration. Since we cannot provide any suggestions without sample code, I would like to ask you to, please, compare any discrepancies between the sample and your own application that may indicate what the root cause of the issue might be. Alternatively, please modify the sample app with only relevant code to reproduce the behavior. Having a working sample on our side, wich we can debug will be highly appreciated, so that we can provide further assistance.
Best regards, Bozhidara Pachilova Associate Software Developer
1884.UltraCalcManagerTest.zip
5633.UltraCalcManagerTest.zip
I have added a Form2 to you project, has a total of 8 ultranumericeditors.Starting from left to right Controls 1 & 2 are added in Control 5, Cintrols 3 & 4 are added in COntrol 6, COntrols 5 & 6 are added in Control7, all of them works, But control 8 that is programmed to simply replicate the value of control 7 is always 0
Thank you for modifying the sample!
I am able to observe this behavior and it appears that the 0 is simply the initial value of the ultraNumericEditor7 formula’s source editor and it is not updated afterwards. I assume this might be related to the nested nature of the formula reference. I will be passing this for discussion with the development team in an effort to confirm whether this would occur by design or can be a candidate for fixing.
Meanwhile, I can suggest implementing the following approach: for all editors referenced like the ultraNumericEditor7 from the sample, add a ValueChanged event handler. It could be a single handler for all such editors, as the same code would be executed for each, namely invoking the NotifyValueChanged method of the CalcManager with the sender control as an argument:
private void ultraNumericEditors_ValueChanged(object sender, EventArgs e) { this.ultraCalcManager1.NotifyValueChanged(sender as Control); }
I believe this is needed, since, taking the ultraNumericEditor7 as an example, it is used as a source of the formula for the ultraNumericEditor8. In the above referenced NotifyValueChanged API page, it is mentioned that if that is the case, raising this notification might be necessary.
I have also added another such control to test the event on two separate editors. On my side, this seems to allow the editors to reflect the updated values. Please, check the updated sample out on your side as well and let me know if it helps.
0820.UltraCalcManagerTestModified.zip