Action disabled: revisions


The DBGrid component displays a database result set in a grid.

The basic setup is to link a dbgrid to a data source which is responsible for distributing data of a dataset to data-aware components. The dataset needs to be linked to a dataset (dbtable/dbquery/csv).

Database connection –> Dataset (Table/Query/...)–> Datasource –> Data aware components (DBGrid)

The database grid is a very flexible and multipurpose component, and therefore might be a bit difficult to get it configured right. Therefore we provide some samples to explain the variety of use:

  • Represent data from a table
  • Represent data from a table with crud function (modal forms)
  • Represent data with grouping and (grand) totals

Representing data from a table.

This is the basic functionality of the component. This setup is required for anything you might want to do with the component. To get started you need to bind the grid to a configured data source (which is bound to a database table, a query, or a CSV). Then apply the required fields to the grid. If you have a table then you can generate a working grid in a few easy steps. Go to the generator wizard, select the database table and generate the form with code. Then modify the representation of the grid.

Property Description Values
AutorefreshIf combined with a form, the grid will refresh after update a record.
ClickToSelectThis property will set/unset a checkbox before the recordtrue/false
DateHeightHeight of grid. Will only be used if FloatingHeight is set to falseinteger
DataIdFieldselect field to be used as unique idstring
DataSidePaginationDecides if the pagination will occur on the server or client. If set to server then the application will provide a new database by accessing the table. This preserves memory on the client side, but it slows performance down. Setting it to client, then the application will send the full resultset to the grid. Both settings have important implications, depending on the use of the grid. If you want to preserve checkboxes over pages then you must use the client side pagination as the data gets lost after processing on the server.
Another thing to consider is the amount of records to be maintained on the client. The dataset can be huge, causing pageload to slow down or crash the browser when the amount of data is huge. It's not very user-friendly to select 1000ths of records and have a page scroll of 10.
DataSortNameName of the field that initial sorts the table.
DataSortOrderSet initial sort to ascending or descendingASC/DESC
DatasourceConnects the grid to a datasource.dropdown of available datasources
FieldsShows property editor for individual fields.see…
HeightHeight of component.integer
LeftPosition of component.Depending on the form mode it might be used or ignored
NameName of component. Change with care.string
ShowColumnsToggle to show columns button. Will show a modal form to show/hide the individual fieldstrue/false
ShowHeaderToggle to show the header.true/false
ShowPaginationToggle to show the pagination.true/false
ShowRefreshToggle to show refresh button.true/false
ShowSearchToggle to show the search field.true/false
Property Description
onActivateSee standard description of events
onAfterRenderSee standard description of events
onBeforeRenderSee standard description of events
onClickRowTriggers when the users clicked on a Row. Use in conjunction with Client event
onClickUserButtonTriggers when the user clicks on a user button
onEachRowTriggers for each record while building the screen
onProcessRowTriggers each row that requires processing after clicking theprocess buton
onRowCheckedTriggers when a user checks a row. use in conjunction with the Client event
Property Description
onClickRowTriggers when a user clicks on a row in a grid
onDocumentReadyTriggers on the 'ondocumentready' signal.
onLoadSuccesTriggers after the grid has loaded data
onPageChangeTriggers when the user clicks on next/previous page
onRefreshTriggers when the user clciks on the refresh button
onRowCheckedTriggers when the user clicks the checkbox on a row.
  • dbgrid.txt
  • Last modified: 2021/06/10 16:22
  • by aducomadmin