Table of Contents

TTMSFNCTreeViewDatabaseAdapter Class

Connects a TDataSource to a tree view, loading dataset records as flat or hierarchical nodes and supporting inline editing, sorting, filtering, and scrolling.

API unit family: TMSFNCTreeViewDatabaseAdapter Inherits from: TTMSFNCTreeViewAdapter

Syntax

TTMSFNCTreeViewDatabaseAdapter = class(TTMSFNCTreeViewAdapter)

Properties

Name Description
AutoCreateColumns True automatically creates column definitions for all visible dataset fields when the datasource opens. Default: True.
AutoRemoveColumns True automatically removes auto-created column definitions when the datasource closes. Default: True.
Columns Column definitions that map dataset fields to tree view columns.
DataLink The TDataLink that monitors the connected datasource for record changes and dataset state transitions.
DataSetType Specifies whether the connected dataset supports absolute record positioning. Default: adsSequenced.
DataSetTypeAuto True lets the adapter detect the DataSetType automatically at runtime. Default: True.
DataSource The TDataSource that supplies the dataset to display in the tree view.
FieldAtColumn Returns the TField at the specified tree view column index, or nil when no field is mapped to that column.
FieldIndexAtColumn Returns the dataset field index at the specified tree view column index, or -1 when no field is mapped.
PostMode Specifies when the adapter automatically posts record edits back to the dataset. Default: apmNode.
ShowBooleanFields True includes Boolean fields in auto-created columns. Default: True.
ShowMemoFields True includes memo fields in auto-created columns. Default: False.
ShowPictureFields True includes picture (BLOB) fields in auto-created columns. Default: True.
Version Version number of this database adapter component.

Methods

Name Description
AddAllFields Creates a column definition for every visible field in the connected dataset.
CheckDataSet Returns True when the connected datasource has an active, open dataset.
LoadAllDataAndDisconnect Loads all records from the connected dataset into the tree view and then disconnects the datasource.
RemoveAllColumns Removes all column definitions and also removes the corresponding columns from the tree view.
RemoveAllFields Removes all column definitions from the adapter.

Events

Name Description
OnGetHTMLTemplate Fires when the adapter needs the HTML template string for a specific cell.
OnGetHTMLTemplateData Fires when the adapter needs a substitution value for a named HTML template placeholder in a specific cell.
OnGetRecordCount Fires when the adapter needs the total record count; use this when the dataset does not expose RecordCount directly.