Spread for ASP.NET 12 Product Documentation
SetFormula
Spread for ASP.NET 12 Product Documentation > Client-Side Scripting Reference > Scripting Members > Methods > SetFormula

Sets the formula in a cell at the specified row and column.

Syntax

[JavaScript]

FpSpread1.SetFormula(row,column,value);

Parameters

row
Integer, row index of cell
column
Integer, column index of cell
value
String, the formula to put in the cell

Return Type

None

Remarks

Both row and column indexes must be integer values and must be valid. The formula is parsed and evaluated when the data is posted back to the server. This method does not cause a postback to occur. For a list of the operators and functions that appear in formulas, refer to the Formula Reference. Be sure to start the formula with an equals sign (=).

Example

This is a sample that contains the method. On the client side, the script that contains the method would look like this:

JavaScript
Copy Code
<script type="text/javascript">
   function setEquation() {
        FpSpread1.SetFormula(5,3,"= A1 + B1 / C1");
   }
</script>
See Also