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 +----------------------------------------------------------------------------+
| Region | Meaning |
|---|---|
| 1 | A line: the field's caption on the left and its value on the right, edited in place like a grid cell |
| 2 | A category header (the rows' Band); clicking it or pressing Left/Right collapses and expands its fields |
| 3 | A field in the category, indented; it uses the same editors as the grid (check box, date, lookup, …) |
| 4 | A 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 likeMe!Field, written to the form's record, and saved by Access). With aRecordSourceandLinkMasterFields = "Grid1", it shows the details for aWklGridorWklTreeList, 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 inWklGrid; the column'sBandis 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.
FieldEditablereturns the state. - Saved field by field as the user leaves each one (
AutoSave), withValidateField,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
Related topics
- WklGrid overview: the editors, rules, and master link that the property grid shares with the grid