Spread Windows Forms 10.0 Product Documentation > Developer's Guide > Customizing Interaction in Cells > Managing Formulas in Cells > Allowing the User to Enter Formulas |
In many of the cell types, users can type in a formula by simply starting with an equals sign (=). You do not need to set a property to allow this. How the result is displayed depends on the cell type. For example, an integer cell type displays the result as an integer, even if the result of the formula is not an integer. In this case, a number may appear rounded. For currency and date cells, specific formatting can be defined. For more information on setting various cell types, refer to Working with Editable Cell Types.
For information on the floating formula bar, where users can type in formulas and select cells dynamically, refer to Setting up the Formula Text Box.
Allow the user to enter formulas by setting the AllowUserFormulas property for the component or the sheet.
This example code sets the Spread component to allow users to enter formulas.
C# |
Copy Code
|
---|---|
fpSpread1.AllowUserFormulas = true;
|
VB |
Copy Code
|
---|---|
FpSpread1.AllowUserFormulas = True
|
Allow the user to enter formulas by setting the AllowUserFormulas property for the component or the sheet.
This example code sets the child sheet to allow users to enter formulas.
C# |
Copy Code
|
---|---|
FarPoint.Win.Spread.SpreadView sv = fpSpread1.GetRootWorkbook();
sv.AllowUserFormulas = true;
|
VB |
Copy Code
|
---|---|
Dim sv As FarPoint.Win.Spread.SpreadView = FpSpread1.GetRootWorkbook sv.AllowUserFormulas = True |