Farbschema: Dunkel
Sie befinden sich hier: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » Data views » WklTreeList

WklTreeList

A hierarchical datasheet for Access forms: a tree with columns, bands, cell editors, conditional formatting, and footer totals. It can do everything `WklTreeView` does, and it can also build the tree itself from flat records.

Get started

Common tasks

Visual aid

+- List1 ---------------------------------------------------------+
|                     |            Values                   [1]   |
| Item                | Quantity |   Price   | Status             |
+---------------------+----------+-----------+--------------------+
| v Order 1001  [2]   |        3 |  129,50 € | (i) open           |
|     Line 1          |        1 |   **99,00 € ** [3]  (*) done   |
|     Line 2          |        2 |   30,50 € | (i) open      [4]  |
| > Order 1002        |        1 |   12,00 € | (*) done           |
+---------------------+----------+-----------+--------------------+
|                     | Sum: 7   | 271,00 €  |               [5]  |
+-----------------------------------------------------------------+
RegionMeaning
1Band: a header above a group of columns (Bands); bands can be nested
2Tree column (TreeColumn): indentation and expand buttons, from the binding of WklTreeView
3Cell formatted by a rule (FormatRules): bold because the price is greater than 30
4Lookup column with symbols (Editor = wedImageLookup): stored value 0, 1 or 2 shown as symbol and text
5Footer with totals (ShowFooter, WklColumn.Summary)

Key features

  • Columns for fields of the record source, with Access formats (Currency, Short Date, #,##0.00, …), alignment, width, sorting by clicking the header, and best fit.
  • Bands: multi-level headers, and records that span several rows.
  • Cell editing with F2, Enter, typing or double-click: text, number, date with calendar, Yes/No, lookup list (table, query, SQL or value list) and lookup list with symbols; ValidateCell can change or refuse a value.
  • Conditional formatting: value comparisons, expressions in Access syntax ([Quantity] < [MinimumStock]), data bars and icon sets.
  • Footer totals: count, sum, minimum, maximum, and average across the records.
  • Column filter as in WklGrid: a filter row, a value list in each column header, and a filter bar. A matching node stays visible with its parent nodes, and optionally with its child nodes.
  • Grouping of flat records (GroupFields): a view or pass-through query without a parent key becomes a tree, grouped by the outermost field first.
  • Export to Excel without Excel installed: the tree becomes an outline, and formats and totals are preserved.
  • UI Automation: screen readers and test tools see a data grid with headers, rows with their level in the tree, and cells with their displayed text.
  • Designer with the Columns, Bands, Format rules, Grid, and Grouping pages and a preview of the real data.

Core concepts

Same data core as the tree. Binding, keys, lazy loading, write-back with transactions, search, filtering, check marks, and all tree events work as in WklTreeView. A column whose field is the TextField holds the node text; changing it renames the node.

Definition saved with the form. Columns, bands, and rules set in design view (in the designer or through VBA) are saved with the form in ColumnLayout. At run time, the same objects (Columns, Bands, FormatRules) change the list directly.

Filtering keeps the tree. Filter and the column filter both hide the nodes that don't match and keep the parent nodes of a match visible, so that each match is seen in its place. FilterIncludesChildren brings the child nodes of a match along. A list that loads lazily asks the record source, so it also finds nodes that aren't loaded yet.

Cells. CellValue(Key, Column) is the stored value, CellText(Key, Column) is the displayed text after formatting and lookup. Group nodes have no field values.

Formatting order. Format rules are applied first, in collection order (StopIfTrue stops further checks). In the tree column, the tree's node formatting (ForeColorField, BoldField, NodeFormat) fills in whatever the rules leave open. CellFormat (only with FormatEvents) receives the result and has the final say.

Administration

Troubleshooting

For developers

en/wiki/msaccess/comctl/data-views/treelist/start.txt · Zuletzt geändert: von Wolfgang van der Stille