Color scheme: Dark
You are here: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » Data views » WklPropertyGrid

WklPropertyGrid

WklPropertyGrid shows a single record as “caption | value” lines grouped into categories, much like the Properties window in Visual Studio. It either shows the details of a list on the same form or displays the current record of its own form.

Get started

Common tasks

Visual aid

+- frmCustomers: Form View --------------------------------------------------+
|  Grid1 (WklGrid)                 | Props1 (WklPropertyGrid)                |
|  +-----------------------------+ | +------------------+------------------+ |
|  | Name        | City          | | | Name             | Carter           | |  1
|  | Adams       | Boston        | | | City             | Denver           | |
|  | Baker       | Chicago       | | | v Status         |                  | |  2
|  |>Carter      | Denver        | | |   Active         | [x]              | |  3
|  +-----------------------------+ | |   Customer since | 3/20/2019        | |
|                                  | |   Display        | Carter (Denver)  | |  4
+----------------------------------------------------------------------------+
RegionMeaning
1A line: the field's caption on the left and its value on the right, edited in place like a grid cell
2A category header (the rows' Band); clicking it or pressing Left/Right collapses and expands its fields
3A field in the category, indented; it uses the same editors as the grid (check box, date, lookup, …)
4A field the source can't write to (here, a calculated field in a query): gray caption, no editor

Key features

  • Two modes: without a RecordSource, it shows its own form's record (read like Me!Field, written to the form's record, and saved by Access). With a RecordSource and LinkMasterFields = "Grid1", it shows the details for a WklGrid or WklTreeList, whose source can even be a pass-through query.
  • Rows are grid columns (Rows, WklColumn): caption, editor, format, lookup, rules (Required, Pattern, MinValue, …), and read-only state work just as in WklGrid; the column's Band is its category. If you don't define any rows, every field becomes a row.
  • Read-only state comes from the source, with nothing to configure: pass-through and union queries, calculated fields, AutoNumber fields, and columns that a linked ODBC table reports as not updatable. FieldEditable returns the state.
  • Saved field by field as the user leaves each one (AutoSave), with ValidateField, BeforeUpdate, DataError, and the grid's error marks.
  • Keyboard and screen reader support that matches the Visual Studio Properties window; each field is announced by its caption.
  • Designer (the Custom [...] row): data, link, appearance, rows with categories, and format rules, with a preview of the lines.

Core concepts

A grid turned on its side. The control is a WklGrid with its own interface: the record source, master link, saving, rules, and editors all come from the grid; only the window draws a single record as lines. Features that make no sense for a single record (grouping, the filter row, detail views, and list view) aren't part of WklPropertyGrid.

In form mode, it edits the form's record. Without a record source, nothing is written behind the form's back: a changed value makes the form's record dirty, and Access saves it, with the form's own validation, when the user leaves or saves the record. The grid follows the form's records on its own, with no code in the form module, and doesn't requery while an editor is open.

The details wait for the master. WklGrid doesn't select a record when the form opens, so a detail grid with LinkMasterFields = "Grid1" stays empty until the user makes the first selection.

Administration

Troubleshooting

For developers

  • WklGrid overview: the editors, rules, and master link that the property grid shares with the grid
en/wiki/msaccess/comctl/data-views/propertygrid/start.txt · Last modified: by Wolfgang van der Stille