Delphi & C++ Builder components library
and Software development
 
 
 

DBStringGrid

DBStringGrid is extension of StringGridEd component (non database grid) with functions for batch loading and saving data from/to dataset.

DBStringGridEd is useful in many situations when user needs to modify more records, data from more tables or data in pivot table with batch saving. Standard DBGrid with record oriented behaviour is usually not suitable.

DBStringGridEd supports 3 basic modes:

  • Simple table mode
  • Predefined rows multitable mode
  • Pivot table mode

Simple table mode

  • load and show all records from one table (similar as DBGrid)
  • columns can be defined manually (use property FieldName, ButtonStyle, DataType) or automatically from dataset structure by procedure CreateTableColumns or property CreateTableColNow
  • property DataSource define link to dataset data
  • property KeyFieldName define name of key field which contain unique record ID, property RowKeyValue can be used to read key value for any row
  • procedures LoadTableRows and SaveTableRows load /save data
  • property AutoAddNewRow defines whether user can add new records
  • event DBBeforePostEvent can be used to check/modify valued before post
  • event OnDBUpdateError can be used to handle any exception
dbstringgrid1

Predefined rows multitable mode

  • load and show values for all predefined rows
  • rows can be defined manually (set property RowKeyValue for each row) or loaded from any table together with fixed column by procedure LoadTableRows (use property DataSource + KeyFieldName)
  • columns for each dataset can be defined manually (use property FieldName, ColumnGroup, ButtonStyle, DataType)
  • procedures LoadTableData and SaveTableData load /save data (parameter KeyField defines link to each RowKeyValue, ColumnGroup defines used columns)
  • event DBBeforePostEvent can be used to check/modify valued before post
  • event OnDBUpdateError can be used to handle any exception
dbstringgrid2

Pivot table mode

  • load and show values for all predefined rows and columns
  • rows can be defined manually (set property RowKeyValue for each row) or loaded from any table together with fixed column by procedure LoadTableRows (use property DataSource + KeyFieldName)
  • columns can be defined manually (set property ColKeyValue for each column) or loaded from any table by procedure LoadPivotColumn (parameter ColumnKeyField is used to define ColKeyValue for each column, ColumnDisplayField define Column Label)
  • procedures LoadPivotData and SavePivotData load /save data (parameter RowKeyField/ColumnKeyField defines link to each RowKeyValue/ColKeyValue)
  • event DBBeforePostEvent can be used to check/modify valued before post
  • event OnDBUpdateError can be used to handle any exception
dbstringgrid3

Download demo projects to see more details.

Open documentation page.

Go back