Rosi ComponentsUnits Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Class TrDBStringGridEd
Unit
rDBStringGridEd
Declaration
type TrDBStringGridEd = class(TrStringGridEd)
Description
enhanced TrStringGridEd component which provides functions for batch loading and saving data from/to dataset. It helps to use simple table, multitable or pivot table data showing and editing
Hierarchy
Overview
Methods
Properties
Description
Methods
|
procedure CreateTableColumns(SkipFixedCol, SetColWidth: boolean; TitleAlignment: TAlignment = taCenter); |
define grid columns properties from Field list of linked datasource, only visible and non graphics fields are used
|
|
procedure LoadTableRows; |
reset grid and load all rows from linked datasource to grid, KeyField value is used to keep ID for each record
|
|
function SaveTableRows(SaveNewRec: boolean = true; DeleteEmptyRec: boolean = true): Longint; |
post all changes to linked dataset, KeyField value is used to locate modified record
|
|
procedure LoadTableData(Dataset: TDataset; KeyField: Tfield; ColumnGroup: integer = 0; ClearCurrentData: boolean = true; LoadAsNewValues: boolean = false); |
use defined columns+rows and load data from Dataset to grid, KeyField value is used to locate row for each record, Column FieldName is used to locate column for each field
|
|
function SaveTableData(Dataset: TDataset; KeyField: Tfield; ColumnGroup: integer = 0; DeleteEmptyRec: boolean = true): integer; |
post all changes to Dataset, KeyField value is used to locate row for each record, Column FieldName is used to locate column for each field
|
|
procedure LoadPivotColumn(Dataset: TDataset; ColumnKeyField, ColumnDisplayField: Tfield; FromColumnIdx: Longint; ColumnGroup: integer = 0); |
define grid columns properties from records of Dataset, for each record one Column is created, ColumnKeyField value is used to keep ID for each column record
|
|
procedure LoadPivotData(Dataset: TDataset; RowKeyField, ColumnKeyField, ValueField: Tfield; ColumnGroup: integer = 0; ClearCurrentData: boolean = true; LoadAsNewValues: boolean = false); |
load data from Dataset to defined Pivot table, RowKeyField value is used to locate row for each record, ColumnKeyField value is used to locate column for each record, ValueField value is stored to cell
|
|
function SavePivotData(Dataset: TDataset; RowKeyField, ColumnKeyField, ValueField: Tfield; ColumnGroup: integer = 0; DeleteEmptyRec: boolean = true) : Longint; |
post all changes to Dataset, RowKeyField and ColumnKeyField value is used to locate/create of record for each changed cell, ValueField is updated from cell
|
|
procedure LoadTableMultiRows; |
load multirows for each record from linked datasource to grid, KeyField value is used to keep ID for each multirow group
|
|
function SaveTableMultiRows(SaveNewRec: boolean = true): Longint; |
post all multirow changes to linked dataset, KeyField value is used to locate modified record
|
|
procedure AddNewRecMultiRows(InsertToTop: boolean = false; InsertInCurrentPos: boolean = false); |
add or insert new empty rows for a new multirow record
|
|
function IsTableMultiRows: boolean; |
define whether LoadTableMultiRows was used to load data
|
|
procedure RefreshMultiRowHeights; |
set row heights for all multirows
|
|
function GetCellMultiRowDef(ACol, ARow: Longint): TrDBStringGridEdMultiRow; |
returns multirow definition for the specific cell
|
|
function GetCellMultiRowType(ACol, ARow: Longint): TMultiRowType; |
returns multirow content type for the cell
|
|
function GetMultiRowFixedCol: integer; |
returns column index of the column used as multirow fixed col
|
|
function GetMultiRowDataCol: integer; |
returns column index of the column used as multirow data col
|
|
function IndexOfRowKeyValue(KeyValue: integer): Longint; |
return index of row with defined key value
|
|
function IndexOfColKeyValue(KeyValue: integer): Longint; |
return index of column with defined key value
|
Properties
|
property RecsUpdatedCount: Longint read FRecsUpdatedCount; |
define number of modified rows
|
|
property CellsUpdatedCount: Longint read FCellsUpdatedCount; |
define number of modified cells
|
|
property WarningList: TStrings read FWarningList; |
define list of warnings during loading data
|
|
property RowKeyValue[ARow:Longint]: integer read GetRowKeyValue write SetRowKeyValue; |
get or set Key Value for defined Row
|
|
property ColKeyValue[ACol:Longint]: integer read GetColKeyValue write SetColKeyValue; |
get or set Key Value for defined Column
|
|
property MultiRowsOptions: TMultiRowsOptions read FMultiRowsOptions write FMultiRowsOptions; |
multirow options
|
|
property MultiRowsPreview: boolean read FMultiRowsPreview write SetMultiRowsPreview default false; |
defines preview of multirow definition in the design time
|
|
property DataSource: TDataSource read GetDataSource write SetDataSource; |
link to connected dataset
|
|
property KeyFieldName: string read FKeyFieldName write FKeyFieldName; |
define name of KeyField which contain ID of each record (should be integer value)
|
|
property CreateTableColNow: boolean read FCreateTableCol write SetCreateTableCol default false; |
used in design time to load column definition from linked datasource
|
|
property DBUpdateCellContent: TDBUpdateCellContent read FDBUpdateCellContent write FDBUpdateCellContent; |
event type used by TrDBStringGridEd to load and store field value for multirow cell
|
|
property DBLoadCellFromField: TDBLoadStoreCellField read FDBLoadCellFromField write FDBLoadCellFromField; |
event used for user defined loading data from field to cell
|
|
property DBStoreCellToField: TDBLoadStoreCellField read FDBStoreCellToField write FDBStoreCellToField; |
event used for user defined storing data from cell to field
|
|
property DBBeforePostEvent: TDBBeforePostEvent read FDBBeforePost write FDBBeforePost; |
event used for modification of dataset before post changes
|
|
property OnDBUpdateError: TUpdateErrorEvent read FDBUpdateError write FDBUpdateError; |
event for error handling
|
Generated by PasDoc 0.15.0.
|