Skip to main content
TeeTree provides powerful database binding capabilities through the TDBTree component, allowing you to display hierarchical data directly from database tables.

Basic Database Connection

The simplest way to connect TeeTree to a database is using the TDBTree component:

Database Tree Wizard

TeeTree includes a visual wizard to configure database connections:

Master-Detail Relationships

Display complex hierarchical data with master-detail table relationships:

Formatting Database Nodes

Customize the appearance of database-bound nodes:

Grouping Database Records

Group database records by multiple fields:

Key Properties

Layout Configuration

The Layout property controls how database data is displayed:
  • Layout[0].DataSet - The dataset to bind to
  • Layout[0].TextField - Field to display as node text
  • Layout[0].ParentField - Field(s) that define parent-child relationships
  • Layout[0].Format - Visual formatting for nodes at this level

Multiple Levels

You can configure multiple layout levels for complex hierarchies:

Best Practices

  • Use BeginUpdate and EndUpdate when refreshing large datasets
  • Close and reopen datasets when changing layout configuration
  • Consider limiting the number of visible levels for very large hierarchies
  • Always call Clear before Refresh when dataset state changes
  • Handle database connection errors gracefully
  • Validate parent-child relationships in your data
  • Provide visual feedback during data loading
  • Use the database wizard for initial setup
  • Format nodes appropriately for the data type

Common Patterns

Self-Referencing Tables

For tables that reference themselves (like employee hierarchies):

Multiple Parent Fields

Group by multiple criteria using semicolon-separated field names: