Editable Property

Returns or sets whether the control allows in-cell editing.

Syntax

[form!]VSFlexGrid.Editable[ = EditableSettings ]

Remarks

If the Editable property is set to a non-zero value, the user may edit the cell contents by typing into the grid.

The settings for the Editable property are described below:

 

Constant

Value

Description

flexEDNone

0

The grid contents cannot be edited by the user.

flexEDKbd

1

The user may initiate edit mode by typing into the current cell.

flexEDKbdMouse

2

The user may initiate edit mode by typing into the current cell or by double-clicking it with the mouse.

True

-1

Equivalent to flexEDKbd. This setting is used only to keep compatibility with earlier versions of the control.

 

By default, the control goes into editing mode when the user presses the edit key (F2), the SPACEBAR, or any printable character. If the Editable property is set to flexEDKbdMouse (2) the control will also go into edit mode when the user double-clicks on a cell.

You may force the control into cell-editing mode using the EditCell method, or prevent it from entering edit mode by trapping the BeforeEdit event and setting the Cancel parameter to True. You may cancel edit mode using the Select statement to select any cell (including the cell being edited).

You may choose to use a regular edit box, drop-down list or drop-down combo, depending on the setting of the ComboList and ColComboList properties. You may also specify an editing mask using the EditMask and ColEditMask properties. Set these properties in response to the BeforeEdit event.

Use the ValidateEdit event to perform data validation, and the AfterEdit event for post-editing work such as re-sorting the control.

To determine whether the control is in edit mode, use the EditWindow property (if it has a non-zero value, the control is in edit mode).

Data Type

EditableSettings (Enumeration)

See Also

VSFlexGrid Control