WklColumn
WklColumn class
Signature
Dim myWklColumn As WklColumn
Summary
A column of a tree list.
Parameters
None
Remarks
A column object is a live view of the list's definition: a change takes effect at once and is saved with the form (WklTreeList.ColumnLayout).
Not created directly; returned by other members of the library.
| Member | Kind | Summary |
|---|---|---|
| `Name` | Property | Gets or sets the unique name of the column. |
| `FieldName` | Property | Gets or sets the field of the record source the column shows. |
| `Caption` | Property | Gets or sets the header text. |
| `Width` | Property | Gets or sets the width in twips. |
| `Visible` | Property | Gets or sets whether the column is shown. |
| `VisibleIndex` | Property | Gets or sets the position of the column in its band row. |
| `Band` | Property | Gets or sets the band that holds the column. |
| `RowIndex` | Property | Gets or sets the row of a multi-row record the column is shown in. |
| `Alignment` | Property | Gets or sets the alignment of the cells. |
| `Format` | Property | Gets or sets the display format, as in Access. |
| `Editor` | Property | Gets or sets the cell editor. |
| `RowSource` | Property | Gets or sets the list of a lookup column. |
| `BoundColumn` | Property | Gets or sets the column of the lookup list that is stored. |
| `DisplayColumn` | Property | Gets or sets the column of the lookup list that is displayed. |
| `ReadOnly` | Property | Gets or sets whether the cells of the column can be edited. |
| `SortDirection` | Property | Gets or sets the sort direction of the column. |
| `SortIndex` | Property | Gets or sets the rank of the column among the sorted columns. |
| `Summary` | Property | Gets or sets the total shown in the footer. |
| `AddImageItem` | Method | Adds an entry to the image lookup list of the column. |
| `ClearImageItems` | Method | Removes all entries of the image lookup list or the status list. |
| `ImageItemCount` | Property | Returns the number of entries of the image lookup list or the status list. |
| `BestFit` | Method | Sets the width to fit the header and the contents. |
| `AddStatusItem` | Method | Adds or replaces the status label of a value. |
| `StatusKindField` | Property | Gets or sets the field of the record that holds the kind of a status label, for values without an entry. |
| `StatusClickable` | Property | Gets or sets whether a status label is a link. |
| `AddCommand` | Method | Adds a command to a command column, or replaces the command of the same name. |
| `ClearCommands` | Method | Removes all commands of a command column. |
| `CommandCount` | Property | Returns the number of commands of a command column. |
| `CommandsDisplay` | Property | Gets or sets when the buttons of a command column are drawn. |
| `MaxVisibleCommands` | Property | Gets or sets the most buttons a record of a command column shows. |
| `Required` | Property | Gets or sets whether a value must be entered in the column's cells. |
| `MaxLength` | Property | Gets or sets the most characters a text in the column may have. |
| `Pattern` | Property | Gets or sets a regular expression the whole entered text must match. |
| `MinValue` | Property | Gets or sets the smallest value allowed in the column. |
| `MaxValue` | Property | Gets or sets the largest value allowed in the column. |
| `ValueList` | Property | Gets or sets the values allowed in the column. |
| `ValidationText` | Property | Gets or sets the message shown instead of the generated one when a value breaks a rule of the column. |
| `OnText` | Property | Gets or sets the text beside a toggle switch that is on. |
| `OffText` | Property | Gets or sets the text beside a toggle switch that is off. |
| `Separator` | Property | Gets or sets the separator between the values of a token column. |
| `Step` | Property | Gets or sets the change of one arrow or Up/Down key in a spin column. |
| `Unit` | Property | Gets or sets the unit shown after the number in a spin column. |
| `Monospace` | Property | Gets or sets whether the column's text is drawn in a fixed-width font. |
| `NullText` | Property | Gets or sets the text an empty cell shows. |
Code example
None
Inheritance
None
Name property
Signature
Property Get Name() As String Property Let Name(RHS As String)
Summary
Gets or sets the unique name of the column.
Parameters
None
Property value: String – The name; used by CellValue, CellText and the events.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
FieldName property
Signature
Property Get FieldName() As String Property Let FieldName(RHS As String)
Summary
Gets or sets the field of the record source the column shows.
Parameters
None
Property value: String – A field name.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Caption property
Signature
Property Get Caption() As String Property Let Caption(RHS As String)
Summary
Gets or sets the header text.
Parameters
None
Property value: String – The text; empty for the field name.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Width property
Signature
Property Get Width() As Long Property Let Width(RHS As Long)
Summary
Gets or sets the width in twips.
Parameters
None
Property value: Long – The width; 1,440 twips are one inch (2.54 cm).
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Visible property
Signature
Property Get Visible() As Boolean Property Let Visible(RHS As Boolean)
Summary
Gets or sets whether the column is shown.
Parameters
None
Property value: Boolean – True to show the column.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
VisibleIndex property
Signature
Property Get VisibleIndex() As Long Property Let VisibleIndex(RHS As Long)
Summary
Gets or sets the position of the column in its band row.
Parameters
None
Property value: Long – The 0-based display position.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Band property
Signature
Property Get Band() As String Property Let Band(RHS As String)
Summary
Gets or sets the band that holds the column.
Parameters
None
Property value: String – The band name; empty for none.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
RowIndex property
Signature
Property Get RowIndex() As Long Property Let RowIndex(RHS As Long)
Summary
Gets or sets the row of a multi-row record the column is shown in.
Parameters
None
Property value: Long – The 0-based row; 0 is the first row.
Remarks
Rows greater than 0 turn every record into several rows, for example to show an address below a name.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Alignment property
Signature
Property Get Alignment() As WklAlignment Property Let Alignment(RHS As WklAlignment)
Summary
Gets or sets the alignment of the cells.
Parameters
None
Property value: `WklAlignment` – A `WklAlignment` constant.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Format property
Signature
Property Get Format() As String Property Let Format(RHS As String)
Summary
Gets or sets the display format, as in Access.
Parameters
None
Property value: String – A named format (Currency, Short Date …) or a format string such as #,##0.00.
Remarks
The format applies to the display, to CellText and to the Excel export. The named formats are accepted in English and in German (Currency or Währung, Short Date or Datum, kurz).
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Editor property
Signature
Property Get Editor() As WklEditor Property Let Editor(RHS As WklEditor)
Summary
Gets or sets the cell editor.
Parameters
None
Property value: `WklEditor` – A `WklEditor` constant.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
RowSource property
Signature
Property Get RowSource() As String Property Let RowSource(RHS As String)
Summary
Gets or sets the list of a lookup column.
Parameters
None
Property value: String – A table, query or SQL statement, or a value list such as 'A';'B';'C'.
Remarks
Used with Editor = wedLookup. BoundColumn and DisplayColumn select the stored and the displayed column of the list.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
BoundColumn property
Signature
Property Get BoundColumn() As Long Property Let BoundColumn(RHS As Long)
Summary
Gets or sets the column of the lookup list that is stored.
Parameters
None
Property value: Long – The 1-based column number.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
DisplayColumn property
Signature
Property Get DisplayColumn() As Long Property Let DisplayColumn(RHS As Long)
Summary
Gets or sets the column of the lookup list that is displayed.
Parameters
None
Property value: Long – The 1-based column number; 0 to display the bound column.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
ReadOnly property
Signature
Property Get ReadOnly() As Boolean Property Let ReadOnly(RHS As Boolean)
Summary
Gets or sets whether the cells of the column can be edited.
Parameters
None
Property value: Boolean – True to prevent editing.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
SortDirection property
Signature
Property Get SortDirection() As WklSortDirection Property Let SortDirection(RHS As WklSortDirection)
Summary
Gets or sets the sort direction of the column.
Parameters
None
Property value: `WklSortDirection` – A `WklSortDirection` constant.
Remarks
Sorting by columns orders sibling nodes; it overrides SortOrder while a column is sorted. A click on a column header sorts by it.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
SortIndex property
Signature
Property Get SortIndex() As Long Property Let SortIndex(RHS As Long)
Summary
Gets or sets the rank of the column among the sorted columns.
Parameters
None
Property value: Long – 0 for the first sort column; -1 when the column is not sorted.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Summary property
Signature
Property Get Summary() As WklSummary Property Let Summary(RHS As WklSummary)
Summary
Gets or sets the total shown in the footer.
Parameters
None
Property value: `WklSummary` – A `WklSummary` constant.
Remarks
The footer is shown with WklTreeList.ShowFooter. The total covers the loaded records; group nodes are not counted.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
AddImageItem method
Signature
Sub AddImageItem(ByVal Value As Variant, ByVal Image As String, Optional ByVal Text As String = "")
Summary
Adds an entry to the image lookup list of the column.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Value | Variant | No | – | The stored value. |
Image | String | No | – | The symbol shown for the value (a name as for ImageField). |
Text | String | Yes | "" | The text shown next to the symbol; empty for none. |
Remarks
Used with Editor = wedImageLookup.
Code example
None
Inheritance
Declared by WklColumn.
ClearImageItems method
Signature
Sub ClearImageItems()
Summary
Removes all entries of the image lookup list or the status list.
Parameters
None
Remarks
None
Code example
None
Inheritance
Declared by WklColumn.
ImageItemCount property
Signature
Property Get ImageItemCount() As Long
Summary
Returns the number of entries of the image lookup list or the status list.
Parameters
None
Property value: Long – The number of entries.
Remarks
Read-only.
Code example
None
Inheritance
Declared by WklColumn.
BestFit method
Signature
Sub BestFit()
Summary
Sets the width to fit the header and the contents.
Parameters
None
Remarks
None
Code example
None
Inheritance
Declared by WklColumn.
AddStatusItem method
Signature
Sub AddStatusItem(ByVal Value As Variant, ByVal Text As String, Optional ByVal Kind As WklStatusKind = wskNeutral, Optional ByVal Image As String = "")
Summary
Adds or replaces the status label of a value.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Value | Variant | No | – | The stored value, such as True or "A". |
Text | String | No | – | The text on the label; empty shows the value itself. |
Kind | `WklStatusKind` | Yes | wskNeutral | A WklStatusKind; default wskNeutral. |
Image | String | Yes | "" | An optional symbol in front of the text (a name as for ImageField). |
Remarks
Used with Editor = wedStatus. The cell shows the label of the entry whose value equals the field; the user changes it with a drop-down list of the labels, as with a lookup. A value without an entry shows its formatted value on a label whose kind comes from StatusKindField, so texts computed per record - “expires in 5 days” - need no entry at all.
In Windows high contrast mode the labels keep no color of their own: they are drawn as outlines in the text color of the theme. A format rule that sets colors on the cell overrides the kind's colors. In an export as shown (wemWysiwyg) the kind's colors become the fill and font color of the cell.
Code example
None
Inheritance
Declared by WklColumn.
StatusKindField property
Signature
Property Get StatusKindField() As String Property Let StatusKindField(RHS As String)
Summary
Gets or sets the field of the record that holds the kind of a status label, for values without an entry.
Parameters
None
Property value: String – A field name of the record source; empty (default): such labels are neutral.
Remarks
The field holds a number 0-4 or a name (ok, warn, bad, info, neutral); anything else is neutral. Usually it is a calculated field of the query, so the rule that decides the kind lives next to the data, for example IIf([GueltigBis] < Date(), 'neutral', IIf([GueltigBis] < Date() + 14, 'warn', 'ok')) AS SchluesselArt. Setting it loads the field with the records.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
StatusClickable property
Signature
Property Get StatusClickable() As Boolean Property Let StatusClickable(RHS As Boolean)
Summary
Gets or sets whether a status label is a link.
Parameters
None
Property value: Boolean – True: a click on the label, or Enter on its cell, raises StatusClick of the grid and does not edit the cell; False (default).
Remarks
Clickable labels are underlined and show the hand cursor, as a hyperlink in an Access datasheet. Typical use: a count such as “3 rules” that opens the rules of the record.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
AddCommand method
Signature
Sub AddCommand(ByVal Name As String, ByVal Caption As String, Optional ByVal Kind As WklCommandKind = wcmNormal, Optional ByVal VisibleField As String = "", Optional ByVal EnabledField As String = "", Optional ByVal DisabledReasonField As String = "", Optional ByVal AccessibleField As String = "", Optional ByVal Shortcut As String = "", Optional ByVal AllowMultiple As Boolean = False)
Summary
Adds a command to a command column, or replaces the command of the same name.
Parameters
| Name | Type | Optional | Default | Description |
|---|---|---|---|---|
Name | String | No | – | The name RowCommand passes (unique in the column). |
Caption | String | No | – | The text of the button; empty: the name. |
Kind | `WklCommandKind` | Yes | wcmNormal | A WklCommandKind; default wcmNormal. |
VisibleField | String | Yes | "" | A field of the record; the command exists for a record when the field is true. Empty (default): always. |
EnabledField | String | Yes | "" | A field of the record; the command can be run when the field is true. Empty (default): always. |
DisabledReasonField | String | Yes | "" | A field with the text shown when the command is disabled - as tooltip, in the menu and as UI Automation help text. |
AccessibleField | String | Yes | "" | A field with the name a screen reader reads, such as “End the session of Jane Doe”; empty: the caption. |
Shortcut | String | Yes | "" | A key that runs the command on the focused record, such as Del, F2 or Ctrl+E; empty: none. |
AllowMultiple | Boolean | Yes | False | True: with several records selected, the command runs once for all selected records in which it is shown and enabled. |
Remarks
Used with Editor = wedCommands; setting that editor clears FieldName, since a command column shows no field. The grid does nothing itself: no delete, no write - RowCommand decides, typically after asking the user. A shortcut is taken before the grid's own keys, so a command on Del never deletes the record, whatever AllowDeletions says; a disabled command takes its key as well and runs nothing.
The fields are read like any field of the record: Null and unreadable values count as false, so a command whose condition is unknown is not offered. Deliver them from the data source; in server mode over ODBC, expressions only Access understands (IIf, Date()) make the grid read through Access instead.
Buttons stand side by side from the left of the cell, at most MaxVisibleCommands; further commands - and buttons that do not fit the column - go into the menu of the “⋯” button. Enter or Space on the focused command cell opens a menu of all the record's commands. For UI Automation every record exposes each of its commands as a button - also while the buttons are not drawn - with Invoke.
Code example
' Sessions: "End" only for open sessions, the spoken name from the record.
Private Sub Form_Load()
With Me!Grid1.Object.Columns.Add("Actions", "Actions")
.Editor = wedCommands
.AddCommand "edit", "Edit"
.AddCommand "end", "End", wcmDestructive, EnabledField:="CanEnd", _
DisabledReasonField:="EndReason", AccessibleField:="EndName", Shortcut:="Del"
End With
End Sub
Inheritance
Declared by WklColumn.
ClearCommands method
Signature
Sub ClearCommands()
Summary
Removes all commands of a command column.
Parameters
None
Remarks
None
Code example
None
Inheritance
Declared by WklColumn.
CommandCount property
Signature
Property Get CommandCount() As Long
Summary
Returns the number of commands of a command column.
Parameters
None
Property value: Long – The number of commands.
Remarks
Read-only.
Code example
None
Inheritance
Declared by WklColumn.
CommandsDisplay property
Signature
Property Get CommandsDisplay() As WklCommandsDisplay Property Let CommandsDisplay(RHS As WklCommandsDisplay)
Summary
Gets or sets when the buttons of a command column are drawn.
Parameters
None
Property value: `WklCommandsDisplay` – A WklCommandsDisplay; default wcdHoverAndSelected.
Remarks
UI Automation exposes the commands of every record in both modes.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
MaxVisibleCommands property
Signature
Property Get MaxVisibleCommands() As Long Property Let MaxVisibleCommands(RHS As Long)
Summary
Gets or sets the most buttons a record of a command column shows.
Parameters
None
Property value: Long – A number from 0; default 2. Further commands go into the “⋯” menu; 0 puts all of them there.
Remarks
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Required property
Signature
Property Get Required() As Boolean Property Let Required(RHS As Boolean)
Summary
Gets or sets whether a value must be entered in the column's cells.
Parameters
None
Property value: Boolean – True when Null, an empty text and a text of blanks are refused; False (default) otherwise.
Remarks
The rule is checked as the other rules of the column (see ValidateMode). The row for a new record checks it before it is saved, also when the user never entered the cell. The value is saved with the form.
Read/write.
Code example
Me!Grid1.Object.Columns("Name").Required = True
Inheritance
Declared by WklColumn.
MaxLength property
Signature
Property Get MaxLength() As Long Property Let MaxLength(RHS As Long)
Summary
Gets or sets the most characters a text in the column may have.
Parameters
None
Property value: Long – A number of characters; 0 (default) for the size of the field in the data source (a Short Text field of 50 allows 50), -1 for no limit.
Remarks
The field size is read from the data source (DAO Field.Size) the first time a text of the column is checked; a field that is no text has no limit. Use -1 for a calculated column whose field size says nothing. The value is saved with the form.
Read/write.
Code example
Me!Grid1.Object.Columns("Kuerzel").MaxLength = 8
Inheritance
Declared by WklColumn.
Pattern property
Signature
Property Get Pattern() As String Property Let Pattern(RHS As String)
Summary
Gets or sets a regular expression the whole entered text must match.
Parameters
None
Property value: String – A .NET regular expression, without ^ and $ (the whole text must match anyway); empty (default) for none.
Remarks
A pattern that is no valid regular expression raises wkeInvalidValue when it is set. An empty cell is not checked against the pattern; set Required as well when a value must be entered. A pattern that takes longer than a quarter of a second on one value counts as not matched. The value is saved with the form.
Read/write.
Code example
' An identifier as SQL Server names it, without hyphen; a network in CIDR notation.
Me!Grid1.Object.Columns("Name").Pattern = "[A-Za-z_][A-Za-z0-9_]*"
Me!Grid1.Object.Columns("Netz").Pattern = "(25[0-5]|2[0-4]\d|1?\d?\d)(\.(25[0-5]|2[0-4]\d|1?\d?\d)){3}/(3[0-2]|[12]?\d)"
Inheritance
Declared by WklColumn.
MinValue property
Signature
Property Get MinValue() As Variant Property Let MinValue(RHS As Variant)
Summary
Gets or sets the smallest value allowed in the column.
Parameters
None
Property value: Variant – A number, a date or a text; Null (default) for none.
Remarks
Numbers compare by value (also a number typed with the user's decimal separator), dates as dates, texts without regard to case, as Access compares text. The value is saved with the form.
Read/write.
Code example
Me!Grid1.Object.Columns("Menge").MinValue = 1
Me!Grid1.Object.Columns("Ab").MinValue = #1/1/2026#
Inheritance
Declared by WklColumn.
MaxValue property
Signature
Property Get MaxValue() As Variant Property Let MaxValue(RHS As Variant)
Summary
Gets or sets the largest value allowed in the column.
Parameters
None
Property value: Variant – A number, a date or a text; Null (default) for none.
Remarks
Compared as MinValue. The message names the range: “"Quantity" must be between 1 and 100.” The value is saved with the form.
Read/write.
Code example
Me!Grid1.Object.Columns("Menge").MaxValue = 100
Inheritance
Declared by WklColumn.
ValueList property
Signature
Property Get ValueList() As String Property Let ValueList(RHS As String)
Summary
Gets or sets the values allowed in the column.
Parameters
None
Property value: String – An Access value list, "a";"b";"c" or a;b;c; empty (default) for any value.
Remarks
Text compares without regard to case, numbers by value. For a choice the user picks from, use a lookup column (Editor wedLookup with RowSource) instead; ValueList checks what is typed. The value is saved with the form.
Read/write.
Code example
Me!Grid1.Object.Columns("Item").ValueList = "from;except_from;database"
Inheritance
Declared by WklColumn.
ValidationText property
Signature
Property Get ValidationText() As String Property Let ValidationText(RHS As String)
Summary
Gets or sets the message shown instead of the generated one when a value breaks a rule of the column.
Parameters
None
Property value: String – A text; empty (default) for the generated messages.
Remarks
As the Validation Text of an Access field, the text replaces the message of every rule of the column. The value is saved with the form.
Read/write.
Code example
Me!Grid1.Object.Columns("Netz").ValidationText = "Ein Netz wie 10.0.0.0/8"
Inheritance
Declared by WklColumn.
OnText property
Signature
Property Get OnText() As String Property Let OnText(RHS As String)
Summary
Gets or sets the text beside a toggle switch that is on.
Parameters
None
Property value: String – A text such as Aktiv; empty (default) for none.
Remarks
Used with Editor = wedToggle. The switch alone (both texts empty) suits narrow columns; a text such as Aktiv/Gesperrt names the meaning where the column caption does not. UI Automation, the search and the export use the texts as well; without them a screen reader hears Ein or Aus. A cell that holds Null (a bit column of SQL Server read over ODBC) shows a gray switch with the knob in the middle and no text; a click turns it on.
A click anywhere in the cell or Space switches it, through BeforeCellEdit, the column's rules, ValidateCell and saving, as typed input; there is no editor. ReadOnly, AllowEditing = False and a refusing BeforeCellEdit keep the value. UI Automation offers the Toggle pattern; its SetValue also takes OnText and OffText. The value is saved with the form.
Read/write.
Code example
With Me!Grid1.Object.Columns("Aktiv")
.Editor = wedToggle
.OnText = "Aktiv"
.OffText = "Gesperrt"
End With
Inheritance
Declared by WklColumn.
OffText property
Signature
Property Get OffText() As String Property Let OffText(RHS As String)
Summary
Gets or sets the text beside a toggle switch that is off.
Parameters
None
Property value: String – A text such as Gesperrt; empty (default) for none.
Remarks
The counterpart of OnText; see there.
Read/write.
Code example
Me!Grid1.Object.Columns("Durchreiche").OffText = "nicht erlaubt"
Inheritance
Declared by WklColumn.
Separator property
Signature
Property Get Separator() As String Property Let Separator(RHS As String)
Summary
Gets or sets the separator between the values of a token column.
Parameters
None
Property value: String – The separator, for example , or |; empty (default) for ;.
Remarks
Used with Editor = wedTokens. The column shows one text field of the record as a row of chips: the field is split at the separator, blanks around each value are removed and empty values are dropped, so Red; Green;;Blue shows three chips. Chips that do not fit are counted in a trailing +n. UI Automation, the search, the copy and the export see the values joined with the separator and one blank (Red; Green; Blue).
The column is read-only, whatever ReadOnly says. The field is usually a query that joins the rows of a child table into one text (an Access query with a VBA function, or STRING_AGG in a SQL Server view), which cannot be written back, and one query per record would not scale to large lists. The values are edited in a WklTokenBox bound to the child table, for example in the edit form of the list.
Read/write.
Code example
With Me!Grid1.Object.Columns("Rollen")
.Editor = wedTokens
.Separator = ","
End With
Inheritance
Declared by WklColumn.
Step property
Signature
Property Get Step() As Double Property Let Step(RHS As Double)
Summary
Gets or sets the change of one arrow or Up/Down key in a spin column.
Parameters
None
Property value: Double – A number greater than 0; default 1. Zero, a negative number or an unreadable one raises wkeInvalidValue.
Remarks
Used with Editor = wedSpin. Up/Down in the cell editor change the number by one step, Page Up/Page Down by ten steps; the result never leaves MinValue and MaxValue of the column. The column shows as many decimal places as the step has (a step of 0.25 shows two), unless Format is set. A typed value outside the limits is refused by the column's rules like any other entry.
Read/write.
Code example
With Me!Grid1.Object.Columns("Laufzeit")
.Editor = wedSpin
.MinValue = 0
.MaxValue = 3650
.Step = 30
.Unit = "Tage"
End With
Inheritance
Declared by WklColumn.
Unit property
Signature
Property Get Unit() As String Property Let Unit(RHS As String)
Summary
Gets or sets the unit shown after the number in a spin column.
Parameters
None
Property value: String – A text, for example “Tage” or “Std.”; empty (default) for none.
Remarks
Display only: the field keeps the number in that unit, and the export writes the number. The cell editor and UI Automation (SetValue) take the number with or without the unit (“30” and “30 Tage”).
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
Monospace property
Signature
Property Get Monospace() As Boolean Property Let Monospace(RHS As Boolean)
Summary
Gets or sets whether the column's text is drawn in a fixed-width font.
Parameters
None
Property value: Boolean – True draws the text in Consolas; False (default) in the font of the list.
Remarks
For code, JSON, SQL or numbers that shall line up. With Editor = wedMemo the zoom box uses the fixed-width font too and keeps long lines unbroken (they scroll sideways).
Read/write.
Code example
None
Inheritance
Declared by WklColumn.
NullText property
Signature
Property Get NullText() As String Property Let NullText(RHS As String)
Summary
Gets or sets the text an empty cell shows.
Parameters
None
Property value: String – A text, for example “–”, “nie” or “kein Ablauf”; empty (default) shows nothing.
Remarks
Display only, in gray: Null and an empty text show it; the field keeps its empty value, and the search, copying and the export see the empty value. Screen readers hear it as the name of the cell.
Read/write.
Code example
None
Inheritance
Declared by WklColumn.