Spread ASP.NET 18
Spread for ASP.NET 18 Product Documentation / Developer's Guide / Customizing with Cell Types / Working with Editable Cell Types / Limiting Values for a Currency Cell
In This Topic
    Limiting Values for a Currency Cell
    In This Topic

    You can set the minimum and maximum values that can be entered in a currency cell and notify the user with a message if the entry is smaller than the minimum or larger than the maximum. Use the MinimumValue and MaximumValue properties of the CurrencyCellType class to set the values.

    Double, integer, and percent cells also support minimum and maximum values.

    Currency Cell Type with Note about Min and Max Values

    To assign the CurrencyCellType to a cell, refer to Setting a Currency Cell.

    Using Code

    1. Create the currency cell type and set a custom error message.
    2. Specify the minimum or maximum value or both of a currency cell type.
    3. Assign the currency cell type to a cell.

    Example

    C#
    Copy Code
    FarPoint.Web.Spread.CurrencyCellType currcell = new FarPoint.Web.Spread.CurrencyCellType("Pick a number between 1 and 10!");
    currcell.MinimumValue = 1;
    currcell.MaximumValue = 10;
    FpSpread1.ActiveSheetView.Cells[1,1].CellType = currcell; 
    
    VB
    Copy Code
    Dim currcell As New FarPoint.Web.Spread.CurrencyCellType("Pick a number between 1 and 10!")
    currcell.MinimumValue = 1
    currcell.MaximumValue = 10
    FpSpread1.ActiveSheetView.Cells(1,1).CellType = currcell 
    

    Using the Spread Designer

    1. In the work area, select the cell or cells for which you want to set the cell type.
    2. Select the Home menu.
    3. Select the SetCellType icon under the CellType section.
    4. Select the cell type and set cell properties such as MinimumValue, MaximumValue, or ErrorMessage.
    5. Select OK to close the dialog.
    6. Click Apply and Exit to close the Spread Designer.
    See Also