Spread WPF Documentation
SetFormula(Int32,Int32,String) Method
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > Worksheet Class > SetFormula Method : SetFormula(Int32,Int32,String) Method
The row index.
The column index.
The formula to place in the specified cell.
Sets a formula in a specified cell in the specified sheet area.
Syntax
'Declaration
 
Public Overloads Sub SetFormula( _
   ByVal row As System.Integer, _
   ByVal column As System.Integer, _
   ByVal formula As System.String _
) 
'Usage
 
Dim instance As Worksheet
Dim row As System.Integer
Dim column As System.Integer
Dim formula As System.String
 
instance.SetFormula(row, column, formula)
public void SetFormula( 
   System.int row,
   System.int column,
   System.string formula
)

Parameters

row
The row index.
column
The column index.
formula
The formula to place in the specified cell.
Example
This example uses the SetFormula method.
gcSpreadSheet1.Sheets[0].SetValue(0, 0, 1);
gcSpreadSheet1.Sheets[0].SetValue(0, 1, 2);
gcSpreadSheet1.Sheets[0].SetValue(1, 0, 10);
gcSpreadSheet1.Sheets[0].Cells[1, 1].Formula = "sum(A1:C1)";
gcSpreadSheet1.Sheets[0].SetFormula(3, 1, "A1+A2");
gcSpreadSheet1.Sheets(0).SetValue(0, 0, 1)
gcSpreadSheet1.Sheets(0).SetValue(0, 1, 2)
gcSpreadSheet1.Sheets(0).SetValue(1, 0, 10)
gcSpreadSheet1.Sheets(0).Cells(1, 1).Formula = "sum(A1:C1)"
gcSpreadSheet1.Sheets(0).SetFormula(3, 1, "A1+A2")
See Also

Reference

Worksheet Class
Worksheet Members
Overload List