DynamicGrid and SQL Table Editor
DynamicGrid components display tabular data from SQL adapters 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 DynamicGrids the go-to component for data entry interfaces, planning input forms, and administration screens.
DynamicGrid Setup
A DynamicGrid 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 DynamicGrid
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.DynamicGrid Properties
| Property | Description |
|---|---|
| Data Adapter | SQL adapter providing the grid data |
| IsEnabled | Whether the grid cells are editable |
| AllowInsert | Whether users can add new rows |
| AllowDelete | Whether users can delete rows |
| DisplayFormat | Grid appearance settings |
The Save Workflow
When the user edits cells and clicks a Save button, the DynamicGrid 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 (0=Insert, 1=Update, 2=Delete) 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 DynamicGrid component bound to the adapter
- A Save button with
SelectionChangedServerTask = ExecuteDashboardExtenderBusinessRule - 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