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 when these are done:
- by pressing F4 key
- by double-clicking cells in edit mode
- by pressing a drop-down button (when DropDownButton property is set to true)
The steps for creating your own subeditor are:
- Create a new Form class for a subeditor.
- Implement ISubEditor interface to the Form which you have just created.
- 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 in a date-time cell, and Customizing the Pop-Up Calculator Control where a calculator subeditor is available to 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 may want to disable the pop-up calendar control; in the number cells, you may want to disable the pop-up calculator control.
To cancel subeditors, you can set e.Cancel to True in the SubEditorOpening event:
private void FpSpread1_SubEditorOpening(object sender, FarPoint.Win.Spread.SubEditorOpeningEventArgs e)
e.Cancel = true;
Private Sub FpSpread1_SubEditorOpening(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.SubEditorOpeningEventArgs) Handles FpSpread1.SubEditorOpening
e.Cancel = True
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.