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
105
CalculationManager support for condtional calculations
posted

Can Excel-like conditional calculation (e.g. IF([Column1] = Value1, [Column2],''] be processed by XamCalculationManager? If yes, where can I find syntax/examples?

Many thanks

Vlad

Parents
  • 34430
    Verified Answer
    Offline posted

    Hello Vlad,

    Thank you for your post.

    The XamCalculationManager does support Excel-like conditional calculation. To see the syntax of this, I would recommend using the XamFormulaEditor, which has a dialog that will allow you to edit and see the required syntax for these formulas. Here is a link to our online documentation about the XamFormulaEditor: http://help.infragistics.com/doc/WPF/2016.1/CLR4.0/?page=xamFormulaEditor_Using.html.

    As I can't seem to find any examples that really demonstrate this, I have created you one. This example shows a XamDataGrid working with the XamCalculationManager to evaluate the following formula: "IF(ISEVEN([id]), [id] + [number], [id] * [number])". This formula is placed on a separate unbound field, and the formula points at a pair of separate fields. This will evaluate on a per-row basis, and can be read as "If the 'id' field is an even number, then this field's value is the value of the 'id' field plus the value of the 'number' field, else it is the value of the 'id' field multiplied by the value of the 'number' field."

    I have attached a sample project to demonstrate the above. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XDGConditionalFormulaCase.zip
Reply Children