Spread for ASP.NET 11 Product Documentation
Using the Formula Extender Control
Spread for ASP.NET 11 Product Documentation > Developer's Guide > Customizing User Interaction > Customizing Interaction with the Overall Component > Using the Formula Extender Control

You can use the formula extender control to calculate values from the Spread control and display the result in other controls such as a text box control.

The following standard .NET controls are supported with the formula extender control:

The following HTML controls are supported with the formula extender control:

Valid formula formats include the control name in brackets and the sheet name. For example:

The FormulaExtender control is located in the Visual Studio toolbox under the GrapeCity Spread section as shown in the following image.

Using the Formula Extender

Use the following steps to use the formula extender control:

  1. Add the formula extender control to the form.
  2. Add a control to display the calculation result (such as a text box).
  3. Select the Formula Entries option by selecting Edit Formula Entries from the formula extender verb or by selecting FormulaEntries from the formula extender property list.

  4. The FormulaEntry Collection editor is displayed.

  5. Select the Add button and specify the control ID and formula. Then select OK.

Using Code

  1. Add a text box control.
  2. Use the AddFormula method.

Example

The following example adds a cell value to a text box control.

C#
Copy Code
FpSpread1.ActiveSheetView.Cells[0, 0].Value = 2;
FpSpread1.ActiveSheetView.Cells[1, 0].Value = 3;
FormulaExtender1.AddFormula("textBox2", "[FpSpread1]Sheet1!A2");
VB
Copy Code
FpSpread1.ActiveSheetView.Cells(0, 0).Value = 2
FpSpread1.ActiveSheetView.Cells(1, 0).Value = 3
FormulaExtender1.AddFormula("textBox2", "[FpSpread1]Sheet1!A2")
See Also