rDBGrid is descendant of standard DBGrid component, so it has same properties plus some new properties, functions and events:
New properties and events:
OptionsEx
defines new set of options:
dgTitleExBtn - define if cell(0,0) works as button, if so, event OnTitleExClick is called
dgTitleBtn - define if cells in title row work as buttons, if so, event OnTitleClick and OnChangeSort is called
dgFixColBtn - define if cells in fixed collumn works as button, if so, event OnFixColClick is called
dgBool, dgMemo, dgGraphic - define if boolean, memo and graphics field will be displayed as glyph
dgDrawRowFocus - define if active row has rectange focus, event OnDrawActiveRowFocus can be used to draw different type of focus
dgDrawColoredRow - define if odd rows has different color, color is defined in property ColorOddRow
dgOneClickCheckbox - define if boolean fields is changed after single click on cell, if false, double click must be used (OnBoolClick event is called after changing of value)
dgDateTimePicker - define if datetime picker is used for all datetime fields
LookupCondition
defines conditions when lookup function is used after key pressing in rDBGrid
lcNever - lookup function is off
lcBrowse - lookup function is used when rDBGrid is in browse mode (dgEditing is false)
lcNotEdit - lookup function is used at any time when dataset is not in edit mode
TextAsMemoSize
defines minimum size of string field when memo editor will be used after doubleclick on cell
ColumnWidth
defines type of automatic changing of column width
cwDefaultWidth - set default width of columns
cwSameWidth - set same width of all columns to fit to windows (autorepeat after resize)
cwAutoWidth - set width of all columns to fit to windows relatively to previous width (autorepeat after resize)
cwDataWidth - set width of all columns according length of string in all records
cwLabelWidth - set width of all columns according length of string in column label (caption)
TitleLines
defines height of title lines (in number of text line)
TitleImages, TitleImageList
TitleImages define for any field index of image from TitleImageList which will be shown in title row
design time dialog can be used for setting of this property (see below)
e.g. LastName=1 (means show picture with index 1 in title of field LastName)
TitleLineText
TitleLineText define text (their font, background color and alignment) which is shown in title row above row labels
DataImages, DataImageList
DataImages define for any field indexes of images from DataImageList which will be shown in data row according field value
e.g.
[Priority]
Low=1
Middle=2
High=3
(means for field Priority show pictures with indexes 1 to 3 according values Low, Middle, High )
design time dialog can be used for setting of this property:
PropSaveFile
defines link to PropSaveFile - it is used for saving of possition of Memo and Graphics dialogs and saved Filter
FieldsAsLink
defines list of fieldname which is displayed as URL link (blue color and underline)
and type of URL link (http, mailto, userdefined - event OnLinkClick is called)
e.g. email=mailto or EmpId=userdefined
design time dialog can be used for setting of this property (see below)
FieldsAsBoolean
FieldsAsBoolean defines list of fieldname which is displayed as boolean field (checkbox)
and defines true and false values for this fields
e.g. Locked=Y;N or Blocked=0;1
design time dialog can be used for setting of this property:
FieldsAutoPickList
defines list of fieldname which use picklist property, picklist values will be automatically loaded from
unique values from the field
OnLoadPickList event can be used for user defined picklists
design time dialog can be used for setting of this property
TitleExPopupMenu
defines link to popup menu, this menu will be displayed after right button click on cell(0,0)
TitlePopupItems
defines content of popup items for calculation of numeric fields (displayed after right button click on title row)
OnChangeSort
procedure (Sender: TObject; DataSet: TDataSet; SortFieldName: string; SortDesc: boolean; var Accept: boolean) of object;
is called after click on title row, this event must sort dataset according SortFieldName and SortDesc; see more details
OnRefreshData
is called to refresh all data (if rDBAction is used), this event must reload all data
OnDrawColumnCellEnd
is called at the end of DrawColumnCell function (after all setting of cell properties),
standard OnDrawColumnCell is called on begin of DrawColumnCell function
OnGetCellParams
is called to set all parameters of each cell to draw
procedure (Sender: TObject; Field: TField; AFont: TFont; var Background: TColor; ActiveRow, Highlight: Boolean) of object;
OnGetHintString
is called to receive text which is shown as hint, as parameters are provided value of field defined by HintFieldName properties and value of selected field
New procedures and functions:
ReSort
Resort grid according actual SortField property - call OnChangeSort event (e.g. after open of dataset)
SaveRowPos , RestoreRowPos
SaveRowPos save possiton of active row in grid, RestoreRowPos move active row to original possition (e.g. after reload)
SaveRowPos;
DataSet.Refresh;
RestoreRowPos;
LoadAutoPickList
reload values for all AutoPickList fields (e.g. after updating of field)
GetInplaceEditor
return pointer to InplaceEditor
StopUpdate(stop: boolean);
procedure stop or start updating of grid
DateTimePicker
return pointer to datetimepicker subcomponent, can be used for editing of their properties
SetLeftCol(ALeftCol: integer)
force to scroll grid horizontally (it is used to synchronize with summary
grid together with GetLeftCol and event OnTopLeftChanged)
SetFooterDBGrid
procedure is used to link grid with summary grid, see demo for more information
Download demo for detailed demonstration of rDBGrid and rDBTools.