Spread Windows Forms 13.0 Product Documentation
Spread Windows Forms 13.0 Product Documentation / Developer's Guide / Customizing Interaction with Cell Types / Understanding Additional Features of Cell Types / Working with a SubEditor
In This Topic
    Working with a SubEditor
    In This Topic

    For several editable cell types (the ones in Working with Editable Cell Types), when you click inside the cell, an editor is displayed. You can go beyond this simple line editor and provide a custom user interface (to provide options to make the task of user input easier). This other level of interface is controlled by the subeditor, or the editor within the cell editor. For example, when you select the date-time cell, you can provide a calendar for the user to select a date. This calendar control would be called by the subeditor.

    Creating a Subeditor

    You can create your own subeditor, which can be displayed by the following actions:

    The steps for creating your own subeditor are:

    1. Create a new Form class for a subeditor.
    2. Implement ISubEditor interface to the Form that you have just created.
    3. Set the subeditor (SubEditor property) to the caller.

    To see an example of a subeditor, refer to Customizing the Pop-Up Date-Time Control where the calendar subeditor is available for a date-time cell, and Customizing the Pop-Up Calculator Control where a calculator subeditor is available for several numeric cell types.

    Canceling a Subeditor

    For several editable cell types, when you click inside the cell, a subeditor is displayed by default. But sometimes you might want to disable these subeditors. For example, in date-time cells you might want to disable the pop-up calendar control; in the number cells, you might want to disable the pop-up calculator control.

    Example

    To cancel subeditors, you can set e.Cancel to True in the SubEditorOpening event, as shown in the following example.

    C#
    Copy Code
    private void fpSpread1_SubEditorOpening(object sender, FarPoint.Win.Spread.SubEditorOpeningEventArgs e)
    {
           e.Cancel = true;
    }
    VB
    Copy Code
    Private Sub fpSpread1_SubEditorOpening(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.SubEditorOpeningEventArgs) Handles FpSpread1.SubEditorOpening
           e.Cancel = True
    End Sub

    For information on the editable cell types, refer to Working with Editable Cell Types.

    For information on other features of cell types, refer to Understanding Additional Features of Cell Types.

    See Also