Spread Windows Forms 8.0 Product Documentation
Working with a SubEditor

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 followinge 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

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options | Documentation Feedback