In Fp spread, how to use a comboBoxCellType's value in another cell's formula

Posted by: tgibson1 on 26 March 2020, 8:13 am EST

  • Posted 26 March 2020, 8:13 am EST

    Hello!

    I need to use the value of a combo box cell in another cell’s formula. More specifically if the combo box has value x I need to set a checkbox cell.

    
    FarPoint.Web.Spread.ComboBoxCellType cbo = new FarPoint.Web.Spread.ComboBoxCellType();
                cbo.DataSource = some data source...;
                cbo.DataValueField = "Id";
                cbo.DataTextField = "Text";
                cbo.ShowButton = true;
    
    sheet.Cells[row, col].Formula = "IF(A1 = 1, true, false)";
    
    
  • Posted 26 March 2020, 8:57 pm EST

    Hi,

    The code snippet provided by you works fine at our end. Once the ComboBox is updated, we need to make save changes to calculate the formula.

    Please refer to the attached sample for reference.

    Regards,

    Manish Gupta

    Spread-ComboBox-Formula.zip

  • Posted 27 March 2020, 1:52 am EST

    In the example, upon updating the combo box selection in the UI a postback occurs. If I were to extract the value of the combo box in the postback I receive the initial value and not the updated value. I believe that this is causing the condition to fail as it is always evaluating the value at first load.

  • Posted 29 March 2020, 7:12 pm EST

    Hi,

    We are sorry, the provided sample in the previous reply works fine and updates the values on Post call.

    Could you please modify the sample depicting your issue and share the steps to replicate it? Also, share the Spread version, you are using.

    Regards,

    Manish Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels