ComponentOne FlexPivot for WinForms
C1.Win.C1FlexGrid.4.8 Assembly / C1.Win.C1FlexGrid Namespace / C1FlexGrid Class / Editor Property

In This Topic
    Editor Property (C1FlexGrid)
    In This Topic
    Gets or sets a reference to the cell editor that is currently active.
    Syntax
    'Declaration
     
    Public Property Editor As Control
    public Control Editor {get; set;}
    Remarks

    The C1FlexGridBase.Editor property returns a reference to the cell editor that is currently active. This may be one of the built-in editors (a TextBox, a ComboBox, or a DateTimePicker control), a custom editor, or null (if the grid is not in edit mode).

    You can use this property to programmatically access the editor, or to find out if the grid is in edit mode.

    If you don't want to use the grid's built-in editors, you can use any other control instead. To do this, either associate the external editor with a specific grid row, column, or CellStyle using the CellStyle.Editor property, which you can get and set at any time.

    Alternatively, you can handle the C1FlexGridBase.StartEdit event and assign any control directly to the C1FlexGridBase.Editor property. (Note that the grid's Editor property can only be assigned while handling the C1FlexGridBase.StartEdit event, and is automatically reset to null when the grid exits edit mode.)

    Any control can be used as an external editor, but to achieve complete integration with the grid, the external editor should implement the IC1EmbeddedEditor interface. Some controls implement this interface natively and don't require any extra code to be used as grid editors (like the ones in the C1Input library). Most, however, will require you to implement at least a few of the methods in IC1EmbeddedEditor.

    For examples of custom editors, please see Using Custom Editors and Creating Custom Editors in this documentation, or visit our on-line sample library at https://www.grapecity.com/en/samples and download the "CustomEditors" sample.

    Example
    The code below uses the C1FlexGridBase.SetupEditor event to customize the current editor by setting two properties.
    See Also