Can't find what you're looking for?

Contact us or post in our forums and we'll help you find an answer.

How to toggle showing formulas in the spread instance in WinForms

Issue:

Assigning formulas to a cell shows the computed value in the cell(s). To see the set formula, end-users must double click the cell.

However, if the spreadsheet contains many cell formulas, it is difficult to double click all the cells one-by-one to validate the formulas. Therefore, the article shows how the end-user can show/hide all formulas at once.

Resolution:

  1. To toggle the cell formulas, we use a simple workaround wherein, we assign the current Text (computed value) to cell’s Tag and set formula to the Text property. Then to re-show the computed value and hide formulas dynamically (like upon ToggleButton Click event, checkbox CheckedChanged event), we assign the Text to cell’s Formula.