Spread Windows Forms 10.0 Product Documentation > Developer's Guide > Customizing Interaction with Cell Types > Understanding Additional Features of Cell Types > Limiting Values for a Numeric Cell |
You can set the minimum and maximum values that can be entered in a cell and notify the user with a message if the entry is smaller than the minimum or larger than the maximum.
The cell types that allow you to set a minimum and maximum value are:
For more information about these cell types, refer to the following topics:
For information on other features of cell types, refer to Understanding Additional Features of Cell Types.
This example creates a currency cell and sets the minimum and maximum values.
C# |
Copy Code
|
---|---|
FarPoint.Win.Spread.CellType.CurrencyCellType currcell = new FarPoint.Win.Spread.CellType.CurrencyCellType(); currcell.MinimumValue = 1; currcell.MaximumValue = 10; fpSpread1.ActiveSheet.Cells[1,1].CellType = currcell; fpSpread1.ActiveSheet.Cells[1,1].Note = "Pick a number between 1 and 10!"; |
VB |
Copy Code
|
---|---|
Dim currcell As New FarPoint.Win.Spread.CellType.CurrencyCellType() currcell.MinimumValue = 1 currcell.MaximumValue = 10 FpSpread1.ActiveSheet.Cells(1,1).CellType = currcell FpSpread1.ActiveSheet.Cells(1,1).Note = "Pick a number between 1 and 10!" |