DynamicGrid and SQL Table Editor
The SQL Table Editor component displays tabular data from a SQL adapter in an editable grid. Users can modify cell values directly in the grid, then save changes back to the database through a Dashboard Extender Business Rule. This makes it the go-to component for data entry interfaces, planning input forms, and administration screens.
SQL Table Editor Setup
A SQL Table Editor requires two pieces:
- SQL Data Adapter — Provides the data to display in the grid
- Dashboard Extender BR — Handles the save operation when the user clicks a Save button
SQL Adapter for the SQL Table Editor
The SQL adapter query defines what data appears in the grid. Each column in the result set becomes a grid column. The query can include
|!Param!| substitution for parameter-driven filtering.SQL Table Editor Properties
| Property | Description |
|---|---|
| Data Adapter | SQL adapter providing the grid data |
| DefaultForAllowColumnUpdates | Whether column values can be edited by default |
| AllowInserts | Whether users can add new rows |
| AllowDeletes | Whether users can delete rows |
| DisplayFormat | Grid appearance settings |
The Save Workflow
When the user edits cells and clicks the built-in Save button, the SQL Table Editor sends the modified data to a Dashboard Extender BR with
FunctionType = SqlTableEditorSaveData. The BR processes the changes and returns a result indicating success or failure.Save Handler Business Rule
The save handler receives the edited data through
args.SqlTableEditorSaveDataTaskInfo and returns a result through XFSqlTableEditorSaveDataTaskResult.XFSqlTableEditorSaveDataTaskInfo Properties
| Property | Description |
|---|---|
| SqlTableEditorDefinition | The SQL Table Editor definition containing table name, view name, and configuration |
| Columns | List of XFDataColumn objects describing the table columns |
| HasPrimaryKeyColumns | Whether the table has primary key columns defined for tracking changes |
| EditedDataRows | List of XFEditedDataRow objects containing the modified rows. Each row has an InsertUpdateOrDelete property (a DbInsUpdateDelType: Insert=0, Update=1, Delete=2) and ModifiedDataRow with the changed values. |
| CustomSubstVars | Custom substitution variables passed from the dashboard |
XFSqlTableEditorSaveDataTaskResult Properties
| Property | Description |
|---|---|
| IsOK | True if the save was successful, False otherwise |
| ShowMessageBox | Whether to display a message box to the user after saving |
| Message | The message text to display |
| CancelDefaultSave | When True, prevents the default save behavior (use when you handle all persistence in the BR) |
Save Handler Example
End-to-End Architecture
The full setup involves:
- A custom SQL table (e.g.,
dbo.PlanningInput) holding the editable data - A SQL data adapter querying that table with
|!Param!|filters - A SQL Table Editor component bound to the adapter, with
ShowSaveButton = TrueandSaveDataTaskType = ExecuteDashboardExtenderBusinessRule(plusSaveDataTaskArgsnaming the BR and function) - A Dashboard Extender BR handling the
SqlTableEditorSaveDatafunction type
Related Content
- Organizing Your Business Rule Code — Dashboard Extender example showing function type dispatch pattern
- Dashboard Business Rules — Full Extender BR implementation details
- Relational Tables — Custom table creation for DynamicGrid backing stores
- Data Adapters — SQL adapter configuration
- GridView — Read-only grid alternative when editing is not needed