Spread Windows Forms 17
Spread Windows Forms 17.0 Product Documentation / Developer's Guide / Cell Types / Working with Editable Cell Types / Setting a GcNumber Cell
In This Topic
    Setting a GcNumber Cell
    In This Topic

    You can create a number cell that displays a side button and calculator. The GcNumberCellType cell is part of the GrapeCity.Win.PluginInputMan assembly.

    Select the side button to display the drop-down calculator as shown in the following image. Select OK to close the calculator.

    Drop-down calculato

    You can specify whether to display 0 if the cell value is null with the AllowDeleteToNull property.

    You can display the pop-up calculator using the Ctrl key and the add, subtract, multiply, or divide key on the number pad while the cell is in edit mode. Press Enter to finish the calculation and accept the value. The following image displays the pop-up calculator.

    Pop-up calculator

    For a complete list of properties, see the GcNumberCellType class.

    Using the Properties Window

    1. At design time, in the Properties window, select the Spread component.
    2. Select the Sheets property.
    3. Click the button to display the SheetView Collection Editor.
    4. In the Members list, select the sheet in which the cells appear.
    5. In the property list, select the Cells property and then click the button to display the Cell, Column, and Row Editor.
    6. Select the cells for which you want to set the cell type.
    7. In the property list, select the CellType property and choose the GcNumber cell type.
    8. Expand the list of properties under the CellType property. Select and set these specific properties as needed.
    9. Click OK to close the Cell, Column, and Row Editor.
    10. Click OK to close the SheetView Collection Editor.

    Using Code

    1. Define the cell by creating an instance of the GcNumberCellType class.
    2. Set properties for the class.
    3. Assign the cell type to a cell or range of cells by setting the CellType property for a cell, column, row, or style to the GcNumberCellType object.

    Example

    This example creates a GcNumber cell.

    C#
    Copy Code
    GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType ncell = new GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType();
    fpSpread1.Sheets[0].Cells[0, 0].CellType = ncell;
    VB
    Copy Code
    Dim ncell As New GrapeCity.Win.Spread.InputMan.CellType.GcNumberCellType()
    fpSpread1.Sheets(0).Cells(0, 0).CellType = ncell

    Using the Spread Designer

    1. Select the cell or cells in the work area.
    2. In the property list, in the Misc category, select CellType. From the drop-down list, choose the GcNumber cell type. Now expand the CellType property and various properties are available that are specific to this cell type. Select and set those properties as needed.

      Or right-click on the cell or cells and select Cell Type. From the list, select GcNumber. In the CellType editor, set the properties you need. Click Apply.

    3. From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.