Spread for ASP.NET 13 Product Documentation
Spread for ASP.NET 13 Product Documentation / Developer's Guide / Customizing with Cell Types / Working with Editable Cell Types / Setting an Integer Cell
In This Topic
    Setting an Integer Cell
    In This Topic

    You can use integer cells to restrict users to entering numeric values as integers only and to display data as integers. The default error message is displayed if the user types a decimal value and tries to leave the cell.

    The following image displays the default error message.

    You can specify an edit mode format with the EditMode property and the IntegerCellType.EditModeSettings class.

    For details on the properties and methods for this cell type, refer to the IntegerCellType class.

    Using Code

    1. Define the integer cell type by creating an instance of the IntegerCellType class.
    2. Assign the integer cell type to a cell.

    Example

    This example sets a cell to be an integer cell.

    C#
    Copy Code
    FarPoint.Web.Spread.IntegerCellType intcell = new FarPoint.Web.Spread.IntegerCellType();
    FpSpread1.ActiveSheetView.Cells[1, 1].CellType = intcell; 
    
    VB
    Copy Code
    Dim intcell As New FarPoint.Web.Spread.IntegerCellType()
    FpSpread1.ActiveSheetView.Cells(1, 1).CellType = intcell 
    

    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 any other cell properties.
    5. Select OK to close the dialog.
    6. Click Apply and Exit to close the Spread Designer.
    See Also