Spread Windows Forms 6.0 Product Documentation
Working with a SubEditor
Support Options
Spread Windows Forms 6.0 Product Documentation > Developer's Guide > Customizing Interaction with Cell Types > Understanding Additional Features of Cell Types > Working with a SubEditor

Glossary Item Box

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:

The steps for creating your own subeditor are:

  1. Create a new Form class for a subeditor.
  2. Implement ISubEditor interface to the Form which 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 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.

Example

To cancel subeditors, you can set e.Cancel to True in the SubEditorOpening event:

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.

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.