constants EditTypeEnum
Use the EditType property to specify the editor for a cell or a column. Any editor can include an associated check box (use the CellHasCheckBox property), a radio button (use the CellHasRadioButton property), or multiple buttons displayed on the left or right side (use the AddButton method). The Mask property applies to most editors that are associated with a standard edit control.

You can use the following to configure editors:

The following edit-related events are triggered in this sequence:

  1. Edit event, This event is raised before the editing process begins. It allows you to prevent the cell from being edited by setting the Cancel parameter to True.
  2. EditOpen event, Triggered once the editing process starts and the editor is displayed. The Editing property returns the handle of the internal editor window being used.
  3. Change event, Fired just before the cell's content is about to change. The NewValue parameter contains the new value that will be assigned to the cell, while the CellValue property holds the current value. If the control is linked to a database, note that the corresponding database field remains unchanged at the time the Change event is triggered.
  4. Changed event, Occurs after the user has successfully changed the content of the cell. The CellValue property now reflects the updated value. If the control is linked to a database, the corresponding field is updated, so the new value is available during the Changed event
  5. EditClose event, Raised when the cell editor is closed and no longer visible.

A cell or a column supports the following editor types:

NameValueDescription
ReadOnly0 The column or the cell has no editor associated.
EditType1 Adds a standard text edit field.

The EditType editor provides the following configurable options:

  • exEditAllowContextMenu, determines whether the editor displays the default context menu on right-click
  • exEditAllowOverType, enables overtype mode in the editor
  • exEditDecimalSymbol, sets the symbol used for decimal points when editing floating-point numbers. The Numeric property must be set to exFloat
  • exEditLimitText, restricts the maximum number of characters the user can enter
  • exEditLockedBackColor, sets the background color of a locked edit control
  • exEditLockedForeColor, sets the foreground color of a locked edit control
  • exEditOverType, indicates whether the editor is in insert or overtype mode
  • exEditPassword, determines whether the edit control displays all characters as asterisks (*) for password input
  • exEditPasswordChar, defines the character used for password masking
  • exEditRight, aligns text to the right in single-line or multiline edit controls
  • exEditSelLength, specifies the number of characters selected when the editor is opened
  • exEditSelStart, specifies the starting position of the text selection when the editor is opened
DropDownType2

The editor offers an intuitive interface that allows users to select values from pre-defined lists displayed in a drop-down window. At the same time, it permits users to enter new values at runtime. The DropDownType editor also includes a standard text edit field. To add predefined values to the drop-down list, use the AddItem or InsertItem methods. The DropDownRows property defines the maximum number of rows visible in the drop-down list. When an item is selected, the editor shows the CellValue rather than the identifier of the item. Additionally, all EditType options are fully supported.

The following sample adds a column with a DropDownType editor:

With .Columns.Add("Editor").Editor
    .EditType = DropDownType
    .AddItem 0, "Single Bed", 1
    .AddItem 1, "Double Bed", 2
    .AddItem 2, "Apartment", 3
    .AddItem 3, "Suite", 4
    .AddItem 4, "Royal Suite", 5
End With
.Items.CellValue(.Items(0), "Editor") = "Apartment"	

The DropDownType editor provides the following configurable options:

  • exAutoDropDownList, automatically shows the drop-down list or selects a matching item while typing
  • exAutoSearch, specifies the kind of searching while the user types characters within the drop-down editor
  • exDropDownBackColor, specifies the drop-down's background color
  • exDropDownColumnAutoResize, specifies whether the drop-down list resizes its visible columns to fit the drop-down width
  • exDropDownColumnCaption, specifies the HTML caption for each column within the drop-down list, separated by ¦ character
  • exDropDownColumnPosition, specifies the position for each column within the drop-down list, separated by ¦ character
  • exDropDownColumnWidth, specifies the width for each column within the drop-down list, separated by ¦ character
  • exDropDownForeColor, specifies the drop-down's foreground color
  • exDropDownImage, displays the predefined icon in the cell when the user selects an item from the drop-down
  • exExpandOnSearch, expands items while the user types characters into the drop-down editor
DropDownListType3 The editor provides an intuitive interface that allows users to select values from predefined lists displayed in a drop-down window. The DropDownListType editor does not include a standard text edit field. Use the AddItem or InsertItem methods to add predefined values to the drop-down list.  The DropDownRows property defines the maximum number of visible rows in the drop-down list. The editor displays the caption of the item that corresponds to the CellValue value. If available, the item's icon is displayed as well.

The following sample adds a column with a DropDownListType editor:

With .Columns.Add("Editor").Editor
    .DropDownAutoWidth = False
    .EditType = DropDownListType
    .AddItem 0, "Single Bed", 1
    .AddItem 1, "Double Bed", 2
    .AddItem 2, "Apartments", 3
    .InsertItem 3, "1 Bed Apartment", 4, 2
    .InsertItem 4, "2 Bed Apartment", 5, 2
    .AddItem 5, "Suite", 4
    .InsertItem 6, "Royal Suite", 1, 5
    .InsertItem 7, "Deluxe Suite", 2, 5
    .ExpandAll
End With
.Items.CellValue(.Items(0), "Editor") = 3

The DropDownListType editor provides the following configurable options:

  • exAutoDropDownList, automatically shows the drop-down list when the user starts typing
  • exAutoSearch, specifies the kind of searching while the user types characters within the drop-down editor
  • exDropDownBackColor, specifies the drop-down's background color
  • exDropDownColumnAutoResize, specifies whether the drop-down list resizes its visible columns to fit the drop-down width
  • exDropDownColumnCaption, specifies the HTML caption for each column within the drop-down list, separated by ¦ character
  • exDropDownColumnPosition, specifies the position for each column within the drop-down list, separated by ¦ character
  • exDropDownColumnWidth, specifies the width for each column within the drop-down list, separated by ¦ character
  • exDropDownForeColor, specifies the drop-down's foreground color
  • exDropDownImage, displays the predefined icon in the cell when the user selects an item from the drop-down
  • exExpandOnSearch, expands items while the user types characters into the drop-down editor
SpinType4 The SpinType editor allows users to view and modify numeric values using a familiar up/down button (spin control) interface. The AddItem or InsertItem methods have no effect when the EditType is set to SpinType. The Numeric property specifies whether the edit control accepts numeric values only.

The SpinType editor provides the following configurable options:

  • exSpinStep, specifies the proposed change when the user clicks the spin control
  • exSpinUpButtonDown, specifies the appearance of the up-button when pressed
  • exSpinUpButtonUp, specifies the appearance of the up-button when released
  • exSpinDownButtonDown, specifies the appearance of the down-button when pressed
  • exSpinDownButtonUp, specifies the appearance of the down-button when released
MemoType5 The MemoType editor is designed to provide a unique and intuitive interface that can be integrated into your application to help users work with textual information. When the content does not fit within the edit box, the editor window automatically expands. The AddItem or InsertItem methods have no effect when the EditType is set to MemoType.

The MemoType editor provides the following configurable options:

  • exMemoAutoSize, specifies whether the MemoType editor resizes automatically when the user changes the text
  • exMemoHScrollBar, adds a horizontal scroll bar to the MemoType editor
  • exMemoVScrollBar, adds a vertical scroll bar to the MemoType editor
CheckListType6 The editor provides an intuitive interface that allows users to check values from predefined lists displayed in a drop-down window. Each item in the list has an associated check box. The editor displays a comma-separated list of item captions, representing an OR combination of the CellValue value. Use the AddItem or InsertItem methods to add new predefined values to the drop-down list. The DropDownRows property defines the maximum number of visible rows in the drop-down list. Use the CheckImage property to customize the appearance of the check boxes.

The following sample adds a column with a CheckListType editor:

With .Columns.Add("Editor").Editor
    .EditType = CheckListType
    .AddItem 1, "Single Bed", 1
    .AddItem 2, "Double Bed", 2
    .AddItem 4, "Apartment", 3
    .AddItem 8, "Suite", 4
    .AddItem 16, "Royal Suite", 5
End With
.Items.CellValue(.Items(0), "Editor") = 5

The editor supports the following options:

  • exDropDownBackColor, specifies the background color of the drop-down list.
  • exDropDownForeColor, specifies the foreground (text) color of the drop-down list.
DateType7 The DateType editor is a date/calendar control (not the Microsoft Calendar Control). The drop-down calendar offers an efficient and visually appealing way to edit dates at runtime. The DateType editor includes a standard edit control. Users can easily select a date either by choosing it from the drop-down calendar or by typing the date directly. The editor displays the CellValue value as a date. To customize how the date is displayed, use the FormatColumn event. The AddItem or InsertItem methods have no effect when the EditType is set to DateType.

The DateType editor allows the following configurable options:

  • exDateAllowNullDate, allows specifying an empty date
  • exDateFirstWeekDay, specifies the first day of the week (0 = Sunday, 1 = Monday, ..., 6 = Saturday)
  • exDateMarkToday, indicates whether the current date is marked
  • exDateMonths, specifies the names of months separated by spaces
  • exDateShowScroll, specifies whether the years scroll bar is visible
  • exDateShowTodayButton, specifies whether the 'Today' button is visible
  • exDateTodayCaption, specifies the caption for the 'Today' button
  • exDateWeekDays, specifies shortcuts for weekdays, separated by spaces
  • exDateWeeksHeader, specifies whether the weeks header is visible

The following sample adds a column with a DateType editor:

With .Columns.Add("Editor").Editor
    .EditType = DateType
End With
.Items.CellValue(.Items(0), "Editor") = Date
MaskType8 The MaskType editor allows users to enter data that includes literals and requires a mask to filter characters during input. This control can be used to enforce the entry of many types of formatted information, such as telephone numbers, social security numbers, IP addresses, and license keys. The Mask property defines the editor’s input mask, while the MaskChar property specifies the character used for masking. The Mask property supports one or more literals: #, x, X, A, ?, <, >, *, \, {nMin,nMax}, […]. The AddItem or InsertItem methods have no effect when the EditType is set to MaskType.

The MaskType editor provides the following configurable options:

  • exEditAllowContextMenu, determines whether the editor displays the default context menu on right-click
  • exEditLimitText, restricts the maximum number of characters the user can enter
  • exEditLockedBackColor, sets the background color of a locked edit control
  • exEditLockedForeColor, sets the foreground color of a locked edit control
  • exEditSelLength, specifies the number of characters selected when the editor is opened
  • exEditSelStart, specifies the starting position of the text selection when the editor is opened

The following sample shows how to mask a column for input phone numbers:

With .Columns.Add("Editor").Editor
    .EditType = MaskType
    .Mask = "(###) ### - ####"
End With
.Items.CellValue(.Items(0), "Editor") = "(214) 345 - 789"
ColorType9 You can include a color selection control in your applications by using the ColorType editor. The editor includes a standard edit control along with a color drop-down window. The color drop-down window contains two tabs for selecting colors: the “Palette” tab displays a grid of colors, while the “System” tab shows the current Windows color constants. The AddItem or InsertItem methods have no effect when the EditType is set to ColorType. 

The ColorType editor allows the following configurable options:

  • exColorShowPalette, specifies whether the palette colors list is displayed
  • exColorShowSystem, specifies whether the system colors list is displayed

The following sample adds a column with a ColorType editor:

With .Columns.Add("Editor").Editor
    .EditType = ColorType
End With
.Items.CellValue(.Items(0), "Editor") = vbRed
See also the ColorListType editor
FontType10 The FontType editor provides an intuitive way to select fonts. It includes a standard edit control and a font drop-down window. The font drop-down window displays a list of all system fonts. The AddItem or InsertItem methods have no effect when the EditType is set to FontType. The DropDownRows property defines the maximum number of visible rows in the drop-down list.

The FontType editor allows the following configurable options:

  • exDropDownRows, specifies the maximum number of visible rows in the drop-down list

The following sample adds a column with a FontType editor:

With .Columns.Add("Editor").Editor
    .EditType = FontType
End With
.Items.CellValue(.Items(0), "Editor") = "Times New Roman"
PictureType11

The PictureType provides an elegant way for displaying the fields of OLE Object type and cells that have a reference to an IPicture interface. An OLE Object field can contain a picture, a Microsoft Clip Gallery, a package, a chart, PowerPoint slide, a word document, a WordPad document, a wave file, an so on. In MS Access you can specify the field type to OLE Object. The DropDownMinWidth property specifies the minimum width for the drop-down window. The drop-down window is scaled based on the picture size.  If your control is bounded to a ADO recordset, it automatically detects the OLE Object fields, so setting the editor's type to PictureType is not necessary.  If your control is not bounded to an ADO recordset you can use the following sample to view OLE objects in the column "OLEObject" ( the sample uses the NWIND database installed in your VB folder. The CellValue property can store a reference to an IPicture interface (returned by LoadPicture).

The PictureType editor allows the following configurable options:

  • exShowPictureType, specifies whether the editor displays the type of the picture

The following sample shows how you can use the PictureType editor with a picture being loaded using the LoadPicture API:

With .Columns.Add("Editor").Editor
.EditType = PictureType
End With
.Items.CellValue(.Items(0), "OLEObject") = .ExecuteTemplate("LoadPicture(`" + App.Path + "\human.png" & "`)")

The AddItem or InsertItem method has no effect, if the EditType is PictureType. 

ButtonType12 The ButtonType editor consists of a standard edit field and a "..." button. The ButtonClick event is triggered when the user clicks the button. The ButtonType editor includes all configurable options of EditType and additionally provides a button for user interaction. The AddItem or InsertItem methods have no effect when the EditType is set to ButtonType. You can also add multiple buttons of any type using the AddButton method. 
ProgressBarType13 The ProgressBarType editor displays a visual progress indicator based on a percentage value. Use the CellValue property to specify the percentage to be shown in the progress bar. The value of CellValue should be between 0 and 100, where 0 represents an empty progress bar and 100 represents a fully filled bar. This allows you to visually represent progress, completion status, or any other percentage-based metric in your application.

The ProgressBarType editor allows the following configurable options:

  • exProgressBarAlignment, specifies the alignment of the caption inside the progress bar editor
  • exProgressBarBackColor, specifies the background color of the progress bar editor
  • exProgressBarMarkTicker, specifies whether the ticker or background of the progress bar is visible or hidden
PickEditType14 The PickEditType editor provides an intuitive interface for users to select values from predefined lists displayed in a drop-down window. It includes a standard edit field that allows users to search for items by typing. The DropDownRows property defines the maximum number of visible rows in the drop-down list. Use the AddItem or InsertItem methods to add new predefined values to the list. The editor displays the caption of the item that matches the CellValue property. If the item has an associated icon, it is also displayed alongside the caption.

The PickEditType editor provides the following configurable options:

  • exAutoDropDownList, automatically shows the drop-down list or selects a matching item while typing
  • exAutoSearch, specifies the kind of searching while the user types characters within the drop-down editor
  • exDropDownBackColor, specifies the drop-down's background color
  • exDropDownColumnAutoResize, specifies whether the drop-down list resizes its visible columns to fit the drop-down width
  • exDropDownColumnCaption, specifies the HTML caption for each column within the drop-down list, separated by ¦ character
  • exDropDownColumnPosition, specifies the position for each column within the drop-down list, separated by ¦ character
  • exDropDownColumnWidth, specifies the width for each column within the drop-down list, separated by ¦ character
  • exDropDownForeColor, specifies the drop-down's foreground color
  • exDropDownImage, displays the predefined icon in the cell when the user selects an item from the drop-down
  • exExpandOnSearch, expands items while the user types characters into the drop-down editor
  • exPickAllowEmpty, allows the PickEditType editor to support empty values

The following sample shows how to add values to a drop down list:

With .Columns.Add("Editor").Editor
    .EditType = PickEditType
    .AddItem 0, "Single Bed", 1
    .AddItem 1, "Double Bed", 2
    .AddItem 2, "Apartment", 3
    .AddItem 3, "Suite", 4
    .AddItem 4, "Royal Suite", 5
End With
.Items.CellValue(.Items(0), "Editor") = "Apartment"
LinkEditType15 The LinkEditType editor allows your application to display and edit hyperlink addresses, providing an intuitive way for users to enter or modify URLs directly within the control. The LinkEditType editor includes all configurable options of EditType, except that clicking the editor opens the hyperlink instead of just editing it.
UserEditorType16 The control can use ActiveX controls as a built-in editor. The UserEditor property is used to define the custom user control. If successful, the UserEditorObject property retrieves the newly created object. 

When using custom editors, the following events are triggered:

The following sample shows how you can setup an user editor, using ExComboBox control:

Set rs = CreateObject("ADOR.Recordset")
With .Columns.Add("Editor").Editor
  .EditType = UserEditorType
  .UserEditor "Exontrol.ComboBox", ""
  With .UserEditorObject
    .BeginUpdate
      .Style = 2
      .ColumnAutoResize = False
      .UseTabKey = False
      .IntegralHeight = True
      .MinHeightList = 128
      rs.Open "Orders", "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb", 3, 3
      .DataSource = rs
    .EndUpdate
  End With
End With

.Items.CellValue(.Items(0), "Editor") = 12

The setup includes VB\UserEdit(1,2,3) and VC\User.Edit sample projects that demonstrate using ExComboBox component as a custom editor within the ExG2antt component (a multi-column combo box control).

ColorListType17 You can also include a color selection control in your application by using the ColorListType editor. This editor hosts a predefined list of colors. By default, the following colors are included: Black, White, Dark Red, Dark Green, Dark Yellow, Dark Blue, Dark Magenta, Dark Cyan, Light Grey, Dark Grey, Red, Green, Yellow, Blue, Magenta, and Cyan. The AddItem method allows you to add additional colors to the color list.

The ColorListType editor provides the following configurable options:

  • exColorListShowName, specifies whether the editor displays the name of the color
  • exDropDownBackColor, specifies the drop down's background color
  • exDropDownForeColor, specifies the drop down's foreground color

The following sample adds few custom colors to the ColorListType editor:

With .Columns.Add("Editor").Editor
    .EditType = ColorListType
    .AddItem 128, "Dark Red"
    .AddItem RGB(0, 128, 0), "Dark Green"
    .AddItem RGB(0, 0, 128), "Dark Blue"
End With
.Items.CellValue(.Items(0), "Editor") = 128
MemoDropDownType18 It provides a multi-line edit control that is displayed within a drop-down window.

The MemoDropDownType editor provides the following configurable options:

  • exMemoDropDownAcceptReturn, determines how the ENTER key behaves: if True, ENTER inserts a new line and CTRL + ENTER closes the editor; if False, CTRL + ENTER inserts a new line and ENTER closes the editor
  • exMemoDropDownHeight, sets the height of the drop-down editor in pixels
  • exMemoDropDownWidth, sets the width of the drop-down editor in pixels
  • exMemoHScrollBar, adds a horizontal scroll bar
  • exMemoVScrollBar, adds a vertical scroll bar
  • exMemoAutoSize, specifies whether the editor resizes when text changes

Use the Items.CellSingleLine property to specify whether the cell displays multiple lines.

The AddItem or InsertItem methods have no effect when the EditType is set to MemoDropDownType.

CheckValueType19 Displays check boxes within columns or individual cells. The CellValue property indicates the current state of the cell’s check box. See also the CellHasCheckBox property.

The CheckValueType editor supports the following options:

  • exCheckValue0: Specifies the check box state displayed for the unchecked state.
  • exCheckValue1: Specifies the check box state displayed for the checked state.
  • exCheckValue2: Specifies the check box state displayed for the partial-check state.

For example, if your cells contain Boolean values (True is -1, False is 0), the control displays the partial-check icon for True values by default. You can override this behavior by executing the following code before assigning the CheckValueType editor:

G2antt1.DefaultEditorOption(exCheckValue2) = 1

This replaces the partial-check appearance with the checked-state appearance.

SliderType20 Adds a slider control to a cell. Use the exSliderWidth, exSliderStep, exSliderMin, and exSliderMax options to configure the slider’s behavior and range. Use the exSpinStep option to hide the spin control. You can customize the visual appearance of the spin control using exSpinUpButtonUp, exSpinUpButtonDown, exSpinDownButtonUp, and exSpinDownButtonDown. To customize the slider’s appearance, use exSliderRange and exSliderThumb.
CalculatorType21 Adds a drop-down calculator to a node. 

The CalculatorType editor provides the following configurable options:

  • exCalcButtons, defines the buttons and their layout in the calculator editor
  • exCalcButtonHeight, sets the height of the calculator buttons in pixels
  • exCalcButtonWidth, sets the width of the calculator buttons in pixels
  • exCalcCannotDivideByZero, specifies the message shown when division by zero occurs
  • exCalcExecuteKeys, determines whether keys execute while the drop-down is hidden
  • exCalcPictureDown, sets the picture for a button in the down state
  • exCalcPictureUp, sets the picture for a button in the up state

All caret-based editors support the following configurable options: