Class TrDBGrid

Unit

Declaration

type TrDBGrid = class(TDBGrid)

Description

enhanced TDBGrid component which provides many new functions (show checkboxes, glyph for graphics and memo fields, build-in editors, pictures in title row or in data cells, multiple line titles, sorting functions etc)

Hierarchy

  • TDBGrid
  • TrDBGrid

Overview

Methods

Public function IsDatasetLinked: boolean;
Public function IsActive: boolean;
Public function IsFiltered: boolean;
Public function IsEmpty: boolean;
Public function IsNotEmpty: boolean; deprecated 'Use IsEmpty instead.';
Public function IsFieldAsBoolean(F: TField): boolean;
Public function FieldAsBooleanValue(F: TField): boolean;
Public function FieldAsBooleanDefValue(F: TField; Value: boolean): variant;
Public procedure RefreshLayout;
Public function ReSort: boolean;
Public function ChangeSort(const NewSortFieldName: string; NewSortDesc: boolean): boolean;
Public function ChangeSortEx(const NewSortFieldName, NewSortDirections: string): boolean;
Public function PosInSortField(const FieldName: string): integer;
Public function GetSortDirection(const FieldName: string): boolean;
Public function SortFieldNamesArr: TSortFieldNames;
Public function SortDirectionsArr: TSortDirections;
Public procedure SetColumnWidth(ColumnWidth: TColumnWidth; AdditionalSpace: integer = 0);
Public procedure SetOneColumnWidth(ColumnWidth: TColumnWidth; Column: TColumn; AdditionalSpace: integer = 0);
Public procedure RestoreColumnsWidth(RestoreVisibility: boolean = true; RestorePosition: boolean = true);
Public procedure SaveRowPos(SetExUpdateLock: boolean = false);
Public procedure RestoreRowPos;
Public function ScrollData(ScrollBy: integer): integer;
Public procedure SaveResetDatasetEvents(Reason: integer = 0);
Public procedure RestoreDatasetEvents(Reason: integer = 0);
Public procedure SetFooterDBGrid(FooterDBGrid: TrDBGrid; const FooterFieldPrefix: string; ShowHSBarMaster, ShowHSBarFooter: boolean);
Public function GetInplaceEditor: TrDBGridInplaceEditEx;
Public procedure HideInplaceEditor;
Public procedure StopUpdate(stop: boolean);
Public procedure LoadAutoPickList;
Public function GetFieldNameColumnIndex(const FieldName: string): integer;
Public function GetLeftCol: integer;
Public procedure SetLeftCol(ALeftCol: integer);
Public function GetActiveCellRect: TRect;
Public procedure DrawBMPInCell(Rect: TRect; Bmp: TBitmap);
Public procedure ShowMemo(Field: TField);
Public procedure ShowGraphic(Field: TField);
Public procedure GetCellParams(Field: TField; AFont: TFont; var Background: TColor; var DataImageDef: TDataImageDef; ActiveRow, Highlight: boolean); virtual;
Public procedure RefreshCellParamsCond;
Public function SummaryResults(Fld: TField; Recalculate: boolean = true): TSummaryResults; overload;
Public function SummaryResults(Column: TColumn; Recalculate: boolean = true): TSummaryResults; overload;
Public procedure RecalculateSummaryResults(UseCalculatedSummaryForPopup: boolean = false);
Public function GetTitleText(Column: TColumn): string;
Public function GetCellValue(Fld: TField; UseDisplayText: boolean = true): string;
Public function CopyCellData(CopyToClipboard: boolean = true): string;
Public procedure CopyFieldsData(FieldNames: TStrings; IncludeTitles: boolean = false);
Public procedure CopyActiveFieldData(IncludeTitles: boolean = false);
Public procedure CopyActiveRecordData(IncludeTitles: boolean = false; IncludeHidden: boolean = false);
Public procedure CopyAllData(IncludeTitles: boolean = false; IncludeHidden: boolean = false);
Public procedure PasteData(AddAsNewRecs: boolean);
Public function FillCellData(FillUp: boolean = false; SpecificFieldNames: string = ''): boolean;
Public function GetFieldGroupInfo(Fld: TField): TGroupInfo;
Public function IsFieldGroupMasterVisible(Fld: TField): boolean;
Public function IsFieldGroupMasterExpanded(Fld: TField): boolean;
Public procedure FixedGroupedCol(SwitchGroupOn: boolean; RestoreDefaults: boolean = false);
Public procedure CollapseGroup(GroupID: integer); overload;
Public procedure CollapseGroup(Fld: TField); overload;
Public procedure ExpandGroup(GroupID: integer); overload;
Public procedure ExpandGroup(Fld: TField); overload;
Public procedure CollapseAll;
Public procedure ExpandAll;
Public procedure ShowFilterDlg(Column: TColumn = nil); deprecated 'Use ShowFunnelFilter instead.';
Public procedure ShowFunnelFilter(Column: TColumn = nil);
Public procedure ShowTextFilter(Column: TColumn = nil);
Public procedure SetTextFilter(Column: TColumn; FilterText: string; ActivateFilter: boolean = true);
Public function DefineColumnFilter(FieldName, FilterCondition, TextFilterValue: string; ActivateFilter: boolean = true): boolean;
Public function GetColumnFilterString: string;
Public function SetFilterForField(Fld: TField; const FilterString: string; MultiFieldFilter: boolean; SetFilter: boolean = true; ShowError: boolean = true) : boolean;
Public procedure ResetFilter;
Public procedure RefreshFilteredFieldNames; deprecated 'Use FilterChangedNotification instead.';
Public procedure FilterChangedNotification;
Public function DataImages_GetSettings(FieldName: string; ConditionList: TStrings; var AddImageAlign: string): integer;
Public procedure DataImages_SetSettings(FieldName: string; ConditionList: TStrings; AddImageAlign: string = '');
Public function Fields_GetGroupList(GroupList: TStrings): integer;
Public function Fields_GetGroupDefinition(GroupID: integer): string;
Public function Fields_GetGroupSettings(GroupDefinition: string; var GroupID: integer; var GroupTitle, ContentCollapsed: string; var TitleFontColor, GroupLineColor: TColor; var GroupLocked: boolean; FieldList: TStrings): boolean;
Public function Fields_SetGroupSettings(GroupID: integer; GroupTitle, ContentCollapsed: string; TitleFontColor, GroupLineColor: TColor; GroupLocked: boolean; FieldList: TStrings): string;
Public function Fields_GetLinkType(FieldName: string): TrLinkType;
Public procedure Fields_SetLinkType(FieldName: string; LinkType: TrLinkType);
Public function Fields_GetBoolValues(FieldName: string): string;
Public procedure Fields_SetBoolValues(FieldName: string; BoolValues: string);
Public function Fields_GetDataBarSettings(FieldName: string; var MinValue, MaxValue: double; var ValueType: TrDataBarText; var ColorFrom, ColorTo: TColor) : boolean;
Public function Fields_SetDataBarSettings(FieldName: string; MinValue, MaxValue: double; ValueType: TrDataBarText = dbtPercent; ColorFrom: TColor = clSkyBlue; ColorTo: TColor = clWhite): string;
Public function Fields_GetStatusBarSettings(FieldName: string; var Steps: integer; var BarType: TrStatusBarType; var ColorAll, ColorDone: TColor): boolean;
Public function Fields_SetStatusBarSettings(FieldName: string; Steps: integer; BarType: TrStatusBarType = sbtProgressBar; ColorAll: TColor = clNone; ColorDone: TColor = clNone): string;
Public function Title_GetImageIndex(FieldName: string): integer;
Public procedure Title_SetImageIndex(FieldName: string; ImageIndex: integer);
Public function Title_GetHint(FieldName: string): string;
Public procedure Title_SetHint(FieldName: string; Hint: string);
Public function FooterRow_GetSettings(FieldName: string; var ContentMask: string; var TextAlignment: TAlignmentDefault; var FontStyles: TFontStylesDefault; var FontColor: TColor; var FontSize: integer; AFont: TFont = nil): boolean;
Public function FooterRow_SetSettings(FieldName: string; ContentMask: string; TextAlignment: TAlignmentDefault = tadDefault; FontStyles: TFontStylesDefault = []; FontColor: TColor = clNone; FontSize: integer = 0): string;

Properties

Public property ScaleRatio: double read FScaleRatio;
Public property MouseDownCoord: TGridCoord read MDownCoord;
Public property SearchText: string read FSearchText write FSearchText;
Public property CellParamsCondList: TCellParamsCondList read FCellParamsCondList;
Public property FilterCombo: TrComboBoxExFilter read FFilterCombo;
Public property FilterPanelCombo: TrComboBoxExFilter read FFilterPanelCombo;
Public property ColumnFilters: TColumnStoredProps read FColumnFilters;
Public property FilteredFieldNames: string read FFilteredFieldNames write SetFilteredFieldNames;
Public property DropDownRowsCount: cardinal read FDropDownRowsCount write FDropDownRowsCount;
Published property OptionsEx2: TOptionsEx2 read FOptionsEx2 write FOptionsEx2;
Published property PropSaveFile: TPropSaveFile read FPropSaveFile write SetPropSaveFile;
Published property CustomGlyphs: TrCustomGlyphs read FCustomGlyphs write SetCustomGlyphs;
Published property GlyphLookStyle: TGlyphLookStyles read FGlyphLookStyle write SetGlyphLookStyle default glsStandard;
Published property GridLookStyle: TGridLookStyles read FGridLookStyle write SetGridLookStyle default grs_Default;
Published property ColorOddRow: TColor read FColorOddRow write SetColorOddRow default clMoneyGreen;
Published property ColorActiveRow: TColor read FColorActiveRow write SetColorActiveRow default clInfoBk;
Published property ColorHotTrackRow: TColor read FColorHotTrackRow write SetColorHotTrackRow default clNone;
Published property ColorRequiredField: TColor read FColorRequiredField write FColorRequiredField default clNone;
Published property FontColorFiltered: TColor read FFontColorFiltered write SetFontColorFiltered default clNavy;
Published property FontColorLink: TColor read FFontColorLink write FFontColorLink default clHighlight;
Published property FontColorReadOnly: TColor read FFontColorReadOnly write FFontColorReadOnly default clGrayText;
Published property SortFieldName: string read FSortFieldName write SetSortFieldName;
Published property SortDesc: boolean read FSortDesc write SetSortDesc default false;
Published property SortDirections: string read FSortDirections write SetSortDirections;
Published property Sorter: TrDBGridCustomSorter read FSorter write SetSorter;
Published property ColumnWidth: TColumnWidth read FColumnWidth write SetFColumnWidth default cwNone;
Published property ColumnWidthAfterDblClick: TColumnWidth read FColumnWidthAfterDblClick write FColumnWidthAfterDblClick default cwDataLabelWidth;
Published property TextAsMemoSize: integer read FTextAsMemoSize_old write FTextAsMemoSize_old stored false;
Published property LookupCondition: TLookupCondition read FLookupCondition write FLookupCondition default lcBrowse;
Published property TitleLines: integer read FTitleLines write SetTitleLines default 1;
Published property RowFixHeight: integer read FRowFixHeight write SetRowFixHeight default 0;
Published property RowLines: integer read FRowLines write SetRowLines default 1;
Published property RowVerticalAlign: TVerticalAlignment read FRowVerticalAlign write SetRowVerticalAlign default taAlignTop;
Published property TitleLineText: TTitleLineText read FTitleLineText write FTitleLineText;
Published property FixedColText: TFixedColText read FFixedColText write FFixedColText;
Published property FooterRow: TFooterRow read FFooterRow write FFooterRow;
Published property PasswordChar: char read FPasswordChar write FPasswordChar default '*';
Published property FieldsAsLink: TStrings read FFieldsAsLink write SetFieldsAsLink;
Published property FieldsAsBoolean: TStrings read FFieldsAsBoolean write SetFieldsAsBoolean;
Published property FieldsAsHTMLText: TStrings read FFieldsAsHTMLText write SetFieldsAsHTMLText;
Published property FieldsAsRichText: TStrings read FFieldsAsRichText write SetFieldsAsRichText;
Published property FieldsAsGraphics: TStrings read FFieldsAsGraphics write SetFieldsAsGraphics;
Published property FieldsAsDate: TStrings read FFieldsAsDate write SetFieldsAsDate;
Published property FieldsAsTime: TStrings read FFieldsAsTime write SetFieldsAsTime;
Published property FieldsAsColor: TStrings read FFieldsAsColor write SetFieldsAsColor;
Published property FieldsAsPassword: TStrings read FFieldsAsPassword write SetFieldsAsPassword;
Published property FieldsAsDataBar: TStrings read FFieldsAsDataBar write SetFieldsAsDataBar;
Published property FieldsAsStatusBar: TStrings read FFieldsAsStatusBar write SetFieldsAsStatusBar;
Published property FieldsAutoPickList: TStrings read FFieldsAutoPickList write SetFieldsAutoPickList;
Published property FieldsDrawDropDown: TStrings read FFieldsDrawDropDown write SetFieldsDrawDropDown;
Published property FieldsFilterButton: TStrings read FFieldsFilterButton write SetFieldsFilterButton;
Published property FieldsFilterMapping: TStrings read FFieldsFilterMapping write SetFieldsFilterMapping;
Published property FieldsFixedColumnWidth: TStrings read FFieldsFixedColumnWidth write SetFieldsFixedColumnWidth;
Published property TitlePopupItems: TStrings read FTitlePopupItems write SetTitlePopupItems;
Published property TitleExPopupMenu: TPopupMenu read FTitleExPopupMenu write SetTitleExPopupMenu;
Published property TitleMergedCellPopupMenu: TPopupMenu read FTitleMergedCellPopupMenu write SetTitleMergedCellPopupMenu;
Published property TitleHints: TStrings read FTitleHints write SetTitleHints;
Published property TitleImageList: TImageList read FTitleImageList write SetTitleImageList;
Published property TitleImages: TStrings read FTitleImages write SetTitleImages;
Published property TitleButtons: TStrings read FTitleButtons write SetTitleButtons;
Published property DataImageList: TImageList read FDataImageList write SetDataImageList;
Published property DataImages: TStringList read FDataImages write SetDataImages;
Published property FieldsGroups: TStringList read FFieldsGroups write SetFieldsGroups;
Published property LookupListItemHeight: integer read FLookupListItemHeight write FLookupListItemHeight default 0;
Published property LookupListItemIncreaseHeight: integer read FLookupListItemIncreaseHeight write FLookupListItemIncreaseHeight default 2;
Published property LookupListItemIncreaseWidth: integer read FLookupListItemIncreaseWidth write FLookupListItemIncreaseWidth default 0;
Published property OnCanEdit: TCanEditEvent read FOnCanEdit write FOnCanEdit;
Published property OnChangeSort: TChangeSortEvent read FOnChangeSort write FOnChangeSort;
Published property OnChangeSortEx: TChangeSortEventEx read FOnChangeSortEx write FOnChangeSortEx;
Published property OnLinkClick: TLinkClickEvent read FOnLinkClick write FOnLinkClick;
Published property OnBoolClick: TLinkClickEvent read FOnBoolClick write FOnBoolClick;
Published property OnTitleButtonClick: TLinkClickEvent read FOnTitleButtonClick write FOnTitleButtonClick;
Published property OnTitleExClick: TNotifyEvent read FOnTitleExClick write FOnTitleExClick;
Published property OnFixColClick: TNotifyEvent read FOnFixColClick write FOnFixColClick;
Published property OnTitleMergedCellClick: TFooterCellClick read FOnTitleMergedCellClick write FOnTitleMergedCellClick;
Published property OnTitlePopupItemClick: TNotifyEvent read FOnTitlePopupItemClick write FOnTitlePopupItemClick;
Published property OnFooterCellClick: TFooterCellClick read FOnFooterCellClick write FOnFooterCellClick;
Published property OnGetFixedColState: TGetFixedColStateEvent read FOnGetFixedColState write FOnGetFixedColState;
Published property OnGetFixedRowState: TGetFixedRowStateEvent read FOnGetFixedRowState write FOnGetFixedRowState;
Published property OnDrawTitleLine: TDrawTitleLineEvent read FOnDrawTitleLine write FOnDrawTitleLine;
Published property OnDrawCellBackground: TDrawCellEvent read FOnDrawCellBackground write FOnDrawCellBackground;
Published property OnDrawTitleCellEnd: TDrawCellEvent read FOnDrawTitleCellEnd write FOnDrawTitleCellEnd;
Published property OnDrawColumnCellEnd: TDrawColumnCellEvent read FOnDrawColumnCellEnd write FOnDrawColumnCellEnd;
Published property OnDrawActiveRowFocus: TDrawColumnCellEvent read FOnDrawActiveRowFocus write FOnDrawActiveRowFocus;
Published property OnGetCellParams: TGetCellParamsEvent read FOnGetCellParams write FOnGetCellParams;
Published property OnGetCellParamsEx: TGetCellParamsEventEx read FOnGetCellParamsEx write FOnGetCellParamsEx;
Published property OnDrawFooterRow: TDrawFooterRowEvent read FOnDrawFooterRow write FOnDrawFooterRow;
Published property OnDrawFooterCell: TDrawFooterCellEvent read FOnDrawFooterCell write FOnDrawFooterCell;
Published property OnLoadPickList: TLoadPickListEvent read FOnLoadPickList write FOnLoadPickList;
Published property OnLoadFilterList: TLoadPickListEvent read FOnLoadFilterList write FOnLoadFilterList;
Published property OnLoadFunnelFilter: TLoadFunnelFilterEvent read FOnLoadFunnelFilter write FOnLoadFunnelFilter;
Published property OnGetHintStringEx: TGetHintStringEventEx read FOnGetHintStringEx write FOnGetHintStringEx;
Published property OnRecalculateSummaryResult: TRecalculateSummaryResultEvent read FOnRecalculateSummaryResult write FOnRecalculateSummaryResult;
Published property OnGetSummaryResult: TGetSummaryResultEvent read FOnGetSummaryResult write FOnGetSummaryResult;
Published property OnPickListDrawItem: TDrawItemEvent read FOnPickListDownItem write FOnPickListDownItem;
Published property OnPickListMeasureItem: TMeasureItemEvent read FOnPickListMeasureItem write FOnPickListMeasureItem;
Published property OnPickListSetSize: Controls.TCanResizeEvent read FOnPickListSetSize write FOnPickListSetSize;
Published property OnGetLookupListItemHeight: TGetLookupListItemHeight read FGetLookupListItemHeight write FGetLookupListItemHeight;
Published property OnGetLookupListItemProps: TGetLookupListItemProps read FGetLookupListItemProps write FGetLookupListItemProps;
Published property OnGetEllipsisButtonFormat: TGetEllipsisButtonFormat read FOnGetEllipsisButtonFormat write FOnGetEllipsisButtonFormat;
Published property OnTopLeftChanged: TNotifyEvent read FOnTopLeftChanged write FOnTopLeftChanged;
Published property OnDataScrolled: TNotifyEvent read FOnDataScrolled write FOnDataScrolled;
Published property BeforeScanDataset: TScanDatasetEvent read FBeforeScanDataset write FBeforeScanDataset;
Published property AfterScanDataset: TScanDatasetEvent read FAfterScanDataset write FAfterScanDataset;
Published property OnColWidthChanged: TColWidthChangedEvent read FOnColWidthChanged write FOnColWidthChanged;
Published property OnSetColumnFilter: TSetColumnFilterEvent read FOnSetColumnFilter write FOnSetColumnFilter;
Published property OnFilterChanged: TNotifyEvent read FFilterChanged write FFilterChanged;
Published property OnFilterPanelButtonClick: TLinkClickEvent read FOnFilterPanelButtonClick write FOnFilterPanelButtonClick;
Published property OnRefreshData: TNotifyEvent read FOnRefreshData write FOnRefreshData;
Published property OnGeneralEvent: TGeneralEvent read FOnGeneralEvent write FOnGeneralEvent;

Description

Methods

Public function IsDatasetLinked: boolean;

indicates whether Grid is linked to any Dataset

Public function IsActive: boolean;

indicates whether linked Dataset is active

Public function IsFiltered: boolean;

indicates whether linked Dataset has active filter

Public function IsEmpty: boolean;

indicates whether Dataset is empty

Public function IsNotEmpty: boolean; deprecated 'Use IsEmpty instead.';

Warning: this symbol is deprecated: Use IsEmpty instead.

indicates whether Dataset is not empty

Public function IsFieldAsBoolean(F: TField): boolean;

indicates whether Field is shown as boolean field

Public function FieldAsBooleanValue(F: TField): boolean;

return boolean value of field

Public function FieldAsBooleanDefValue(F: TField; Value: boolean): variant;

return variant value of field and status

Public procedure RefreshLayout;

force LayoutChange event

Public function ReSort: boolean;

manually resort grid - calls Sorter.DoSort procedure or OnChangeSortEx or OnChangeSort event

Public function ChangeSort(const NewSortFieldName: string; NewSortDesc: boolean): boolean;

set new sort properties and call Sorter DoSort procedure or OnChangeSort procedure, obsolete, use ChangeSortEx for multifield sorting

Public function ChangeSortEx(const NewSortFieldName, NewSortDirections: string): boolean;

set new sort properties and call Sorter DoSort procedure or OnChangeSortEx procedure

Public function PosInSortField(const FieldName: string): integer;

returns position of SelFldName in SortFieldName (0=not found)

Public function GetSortDirection(const FieldName: string): boolean;

returns sort direction for field (true=DESC, false=ASC)

Public function SortFieldNamesArr: TSortFieldNames;

returns array of sort fields

Public function SortDirectionsArr: TSortDirections;

returns array of sort directions

Public procedure SetColumnWidth(ColumnWidth: TColumnWidth; AdditionalSpace: integer = 0);

change all column widths according ColumnWidth parameter and increase width by Additional space

Public procedure SetOneColumnWidth(ColumnWidth: TColumnWidth; Column: TColumn; AdditionalSpace: integer = 0);

changes one column width according ColumnWidth parameter

Public procedure RestoreColumnsWidth(RestoreVisibility: boolean = true; RestorePosition: boolean = true);

changes all columns position, width and visibility according original loaded state

Public procedure SaveRowPos(SetExUpdateLock: boolean = false);

save internal position of selected row in grid, use RestoreRowPos to restore the same possition, if SetExUpdateLock=true then all drawing is blocked till RestoreRowPos is called

Public procedure RestoreRowPos;

moved grid to same row with same dataset record as was saved by SaveRowPos

Public function ScrollData(ScrollBy: integer): integer;

scroll data inside the grid with keeping of active record

Public procedure SaveResetDatasetEvents(Reason: integer = 0);

store and reset all dataset and datasource events for quick movement throught all records

Public procedure RestoreDatasetEvents(Reason: integer = 0);

restore all dataset and datasource events stored by SaveResetDatasetEvents

Public procedure SetFooterDBGrid(FooterDBGrid: TrDBGrid; const FooterFieldPrefix: string; ShowHSBarMaster, ShowHSBarFooter: boolean);

link another grid as footer DBGrid and set all properties

Public function GetInplaceEditor: TrDBGridInplaceEditEx;

returns used InplaceEditor

Public procedure HideInplaceEditor;

hide InplaceEditor

Public procedure StopUpdate(stop: boolean);

stop or start updating of grid, used mainly for internal purposes

Public procedure LoadAutoPickList;

load PickList values for all AutoPickList fields, use OnLoadPickList event for loading by used defined query

Public function GetFieldNameColumnIndex(const FieldName: string): integer;

return column index for specific field name

Public function GetLeftCol: integer;

returns index of left column

Public procedure SetLeftCol(ALeftCol: integer);

set left column of grid (move grids scrollbar to right)

Public function GetActiveCellRect: TRect;

returns rect of active cell, can be used in some events

Public procedure DrawBMPInCell(Rect: TRect; Bmp: TBitmap);

draw bitmap in cell rectangle

Public procedure ShowMemo(Field: TField);

show memo editor for the field

Public procedure ShowGraphic(Field: TField);

show graphics editor for the field

Public procedure GetCellParams(Field: TField; AFont: TFont; var Background: TColor; var DataImageDef: TDataImageDef; ActiveRow, Highlight: boolean); virtual;

evaluate conditions for selected field and active record and returns Font, Background and image definition

Public procedure RefreshCellParamsCond;

refresh grid colors after changing of CellParamCondList

Public function SummaryResults(Fld: TField; Recalculate: boolean = true): TSummaryResults; overload;

return summary results for Field

Public function SummaryResults(Column: TColumn; Recalculate: boolean = true): TSummaryResults; overload;

return summary results for Column

Public procedure RecalculateSummaryResults(UseCalculatedSummaryForPopup: boolean = false);

recalculate summary results for all field, paramater define that calculated result is used also for popup summary

Public function GetTitleText(Column: TColumn): string;

get displayed title for the column (group title is used for groupped column)

Public function GetCellValue(Fld: TField; UseDisplayText: boolean = true): string;

get displayed value for the field (group value is used for groupped column)

Public function CopyCellData(CopyToClipboard: boolean = true): string;

copy data from selected cell to clipboard

Public procedure CopyFieldsData(FieldNames: TStrings; IncludeTitles: boolean = false);

copy data from defined field list and all records to clipboard

Public procedure CopyActiveFieldData(IncludeTitles: boolean = false);

copy data from selected field and all records to clipboard

Public procedure CopyActiveRecordData(IncludeTitles: boolean = false; IncludeHidden: boolean = false);

copy data from active record and all fields to clipboard

Public procedure CopyAllData(IncludeTitles: boolean = false; IncludeHidden: boolean = false);

copy data from whole dataset to clipboard

Public procedure PasteData(AddAsNewRecs: boolean);

paste data from clipboard to dataset

Public function FillCellData(FillUp: boolean = false; SpecificFieldNames: string = ''): boolean;

copy data from selected cell to next/previous record

Public function GetFieldGroupInfo(Fld: TField): TGroupInfo;

returns GroupInfo record for field

Public function IsFieldGroupMasterVisible(Fld: TField): boolean;

indicates whether master field of the same group as Fld is visible

Public function IsFieldGroupMasterExpanded(Fld: TField): boolean;

indicates whether master field of the same group as Fld is expanded

Public procedure FixedGroupedCol(SwitchGroupOn: boolean; RestoreDefaults: boolean = false);

rearrange all grouped columns to be together = should be called after user defined column moving

Public procedure CollapseGroup(GroupID: integer); overload;

collapse one group defined by GroupID

Public procedure CollapseGroup(Fld: TField); overload;

collapse one group defined by Field

Public procedure ExpandGroup(GroupID: integer); overload;

expand one group defined by GroupID

Public procedure ExpandGroup(Fld: TField); overload;

expand one group defined by Field

Public procedure CollapseAll;

collapse all groups

Public procedure ExpandAll;

expand all groups

Public procedure ShowFilterDlg(Column: TColumn = nil); deprecated 'Use ShowFunnelFilter instead.';

Warning: this symbol is deprecated: Use ShowFunnelFilter instead.

show funnel filter dialog for active or given column (deprecated 'Use ShowFunnelFilter instead.')

Public procedure ShowFunnelFilter(Column: TColumn = nil);

show funnel filter dialog for active or given column

Public procedure ShowTextFilter(Column: TColumn = nil);

show text filter box for active or given column

Public procedure SetTextFilter(Column: TColumn; FilterText: string; ActivateFilter: boolean = true);

show text filter box for active or given column and set filter text

Public function DefineColumnFilter(FieldName, FilterCondition, TextFilterValue: string; ActivateFilter: boolean = true): boolean;

add ColumnFilter condition

Public function GetColumnFilterString: string;

return actual filter string defined by ColumnFilters

Public function SetFilterForField(Fld: TField; const FilterString: string; MultiFieldFilter: boolean; SetFilter: boolean = true; ShowError: boolean = true) : boolean;

set filter string for particular field

Public procedure ResetFilter;

reset filter and filter bar

Public procedure RefreshFilteredFieldNames; deprecated 'Use FilterChangedNotification instead.';

Warning: this symbol is deprecated: Use FilterChangedNotification instead.

refresh list of field which is used in filter - loaded directly from filter string

Public procedure FilterChangedNotification;

notify rDBGrid that filter was changed externally, funnel state and filter list is updated

Public function DataImages_GetSettings(FieldName: string; ConditionList: TStrings; var AddImageAlign: string): integer;

return DataImages settings for one field

Public procedure DataImages_SetSettings(FieldName: string; ConditionList: TStrings; AddImageAlign: string = '');

set or update DataImages settings for one field

Public function Fields_GetGroupList(GroupList: TStrings): integer;

return list of group definitions from FieldGroup

Public function Fields_GetGroupDefinition(GroupID: integer): string;

return group definition from FieldGroup for one GroupID

Public function Fields_GetGroupSettings(GroupDefinition: string; var GroupID: integer; var GroupTitle, ContentCollapsed: string; var TitleFontColor, GroupLineColor: TColor; var GroupLocked: boolean; FieldList: TStrings): boolean;

return FieldGroup settings for one GroupDefinition

Public function Fields_SetGroupSettings(GroupID: integer; GroupTitle, ContentCollapsed: string; TitleFontColor, GroupLineColor: TColor; GroupLocked: boolean; FieldList: TStrings): string;

set or update FieldGroup settings for one GroupID

Public function Fields_GetLinkType(FieldName: string): TrLinkType;

return FieldsAsLink settings for one field

Public procedure Fields_SetLinkType(FieldName: string; LinkType: TrLinkType);

set or update FieldsAsLink settings for one field

Public function Fields_GetBoolValues(FieldName: string): string;

return FieldsAsBoolean settings for one field

Public procedure Fields_SetBoolValues(FieldName: string; BoolValues: string);

set or update FieldsAsBoolean settings for one field

Public function Fields_GetDataBarSettings(FieldName: string; var MinValue, MaxValue: double; var ValueType: TrDataBarText; var ColorFrom, ColorTo: TColor) : boolean;

return FieldsAsDataBar settings for one field

Public function Fields_SetDataBarSettings(FieldName: string; MinValue, MaxValue: double; ValueType: TrDataBarText = dbtPercent; ColorFrom: TColor = clSkyBlue; ColorTo: TColor = clWhite): string;

set or update FieldsAsDataBar settings for one field

Public function Fields_GetStatusBarSettings(FieldName: string; var Steps: integer; var BarType: TrStatusBarType; var ColorAll, ColorDone: TColor): boolean;

return FieldsAsStatusBar settings for one field

Public function Fields_SetStatusBarSettings(FieldName: string; Steps: integer; BarType: TrStatusBarType = sbtProgressBar; ColorAll: TColor = clNone; ColorDone: TColor = clNone): string;

set or update FieldsAsStatusBar settings for one field

Public function Title_GetImageIndex(FieldName: string): integer;

return TitleImages settings for one field

Public procedure Title_SetImageIndex(FieldName: string; ImageIndex: integer);

set or update TitleImages settings for one field

Public function Title_GetHint(FieldName: string): string;

return TitleHint settings for one field

Public procedure Title_SetHint(FieldName: string; Hint: string);

set or update TitleHint settings for one field

Public function FooterRow_GetSettings(FieldName: string; var ContentMask: string; var TextAlignment: TAlignmentDefault; var FontStyles: TFontStylesDefault; var FontColor: TColor; var FontSize: integer; AFont: TFont = nil): boolean;

return FooterRow.FieldFooterDefs settings for one field

Public function FooterRow_SetSettings(FieldName: string; ContentMask: string; TextAlignment: TAlignmentDefault = tadDefault; FontStyles: TFontStylesDefault = []; FontColor: TColor = clNone; FontSize: integer = 0): string;

set or update FooterRow.FieldFooterDefs settings for one field

Properties

Public property ScaleRatio: double read FScaleRatio;

define actual scale ratio relative to original designed size

Public property MouseDownCoord: TGridCoord read MDownCoord;

returns grid coord of last Mouse down (click or dblclick)

Public property SearchText: string read FSearchText write FSearchText;

indicates current search text for Grid search or Lookup or PickList search

Public property CellParamsCondList: TCellParamsCondList read FCellParamsCondList;

list of conditions defining cell colors

Public property FilterCombo: TrComboBoxExFilter read FFilterCombo;

Returns TrComboBoxEx for setting of Filter TextBar combo

Public property FilterPanelCombo: TrComboBoxExFilter read FFilterPanelCombo;

Returns TrComboBoxEx for setting of FilterPanel combo

Public property ColumnFilters: TColumnStoredProps read FColumnFilters;

array of column filters defined by Filter TextBar

Public property FilteredFieldNames: string read FFilteredFieldNames write SetFilteredFieldNames;

define list of field which is used in filter = show active filter glyph

Public property DropDownRowsCount: cardinal read FDropDownRowsCount write FDropDownRowsCount;

define number of rows for picklist

Published property OptionsEx2: TOptionsEx2 read FOptionsEx2 write FOptionsEx2;

new version of extended options setting, replace the obsolete OptionsEx

Published property PropSaveFile: TPropSaveFile read FPropSaveFile write SetPropSaveFile;

define link to PropSaveFile which is used for saving of possition of dialogs

Published property CustomGlyphs: TrCustomGlyphs read FCustomGlyphs write SetCustomGlyphs;

defines link to rCustomGlyphs component which can define custom glyphs used by grid and other components

Published property GlyphLookStyle: TGlyphLookStyles read FGlyphLookStyle write SetGlyphLookStyle default glsStandard;

Defines look of glyphs for memo and graphics fields

Published property GridLookStyle: TGridLookStyles read FGridLookStyle write SetGridLookStyle default grs_Default;

Defines used color theme (gradient, backgrounf, fonts)

Published property ColorOddRow: TColor read FColorOddRow write SetColorOddRow default clMoneyGreen;

Defines color of each odd row, works only for bidirectional dataset

Published property ColorActiveRow: TColor read FColorActiveRow write SetColorActiveRow default clInfoBk;

Defines color of active row

Published property ColorHotTrackRow: TColor read FColorHotTrackRow write SetColorHotTrackRow default clNone;

Defines color of hot track (mouse over) row

Published property ColorRequiredField: TColor read FColorRequiredField write FColorRequiredField default clNone;

Defines color of required field (for active or all rows)

Published property FontColorFiltered: TColor read FFontColorFiltered write SetFontColorFiltered default clNavy;

Defines text color when dataset is filtered

Published property FontColorLink: TColor read FFontColorLink write FFontColorLink default clHighlight;

Defines text color of link cells (http, mail)

Published property FontColorReadOnly: TColor read FFontColorReadOnly write FFontColorReadOnly default clGrayText;

Defines text color when field or column is readonly during editing

Published property SortFieldName: string read FSortFieldName write SetSortFieldName;

Defines which columns has sort marker, supports MultiField (e.g. FirtsName,LastName)

Published property SortDesc: boolean read FSortDesc write SetSortDesc default false;

Defines direction of sort marker

Published property SortDirections: string read FSortDirections write SetSortDirections;

Defines directions in case of multifield, A=Asc, D=Desc, e.g. A,D,A

Published property Sorter: TrDBGridCustomSorter read FSorter write SetSorter;

Defines sorter component - descendant of TrDBGridCustomSorter

Published property ColumnWidth: TColumnWidth read FColumnWidth write SetFColumnWidth default cwNone;

Defines type of automatic changing of column width

Published property ColumnWidthAfterDblClick: TColumnWidth read FColumnWidthAfterDblClick write FColumnWidthAfterDblClick default cwDataLabelWidth;

Defines type of automatic changing of column width after double click on column border in title row

Published property TextAsMemoSize: integer read FTextAsMemoSize_old write FTextAsMemoSize_old stored false;

Defines minimum size of string field for using a memo dialog for editation

Published property LookupCondition: TLookupCondition read FLookupCondition write FLookupCondition default lcBrowse;

Defines in which situation lookup is started after keypress

Published property TitleLines: integer read FTitleLines write SetTitleLines default 1;

Defines number of lines in title row

Published property RowFixHeight: integer read FRowFixHeight write SetRowFixHeight default 0;

Defines fixed height of data rows in pixel

Published property RowLines: integer read FRowLines write SetRowLines default 1;

Defines number of lines in data row (height is calculated automatically)

Published property RowVerticalAlign: TVerticalAlignment read FRowVerticalAlign write SetRowVerticalAlign default taAlignTop;

Defines vertical alignment for data row - used only if RowLines>1

Published property TitleLineText: TTitleLineText read FTitleLineText write FTitleLineText;

define properties for header text in title line, see TTitleLineText

Published property FixedColText: TFixedColText read FFixedColText write FFixedColText;

define properties for text in fixed column, see TFixedColText

Published property FooterRow: TFooterRow read FFooterRow write FFooterRow;

define properties for summary footer row, see TFooterRow

Published property PasswordChar: char read FPasswordChar write FPasswordChar default '*';

Defines char used as mask for password fields, see FieldsAsPassword

Published property FieldsAsLink: TStrings read FFieldsAsLink write SetFieldsAsLink;

Defines list of fields as link with link type (can be set easily by design time dialog)

Published property FieldsAsBoolean: TStrings read FFieldsAsBoolean write SetFieldsAsBoolean;

Defines list of fields as boolean fields with TRUE FALSE values (can be set easily by design time dialog)

Published property FieldsAsHTMLText: TStrings read FFieldsAsHTMLText write SetFieldsAsHTMLText;

Defines list of fields with HTML content (can be set easily by design time dialog)

Published property FieldsAsRichText: TStrings read FFieldsAsRichText write SetFieldsAsRichText;

Defines list of fields with RTF content (can be set easily by design time dialog)

Published property FieldsAsGraphics: TStrings read FFieldsAsGraphics write SetFieldsAsGraphics;

Defines list of fields as graphics fields (can be set easily by design time dialog)

Published property FieldsAsDate: TStrings read FFieldsAsDate write SetFieldsAsDate;

Defines list of fields displayed as date fields (can be set easily by design time dialog)

Published property FieldsAsTime: TStrings read FFieldsAsTime write SetFieldsAsTime;

Defines list of fields displayed as time fields (can be set easily by design time dialog)

Published property FieldsAsColor: TStrings read FFieldsAsColor write SetFieldsAsColor;

Defines list of fields displayed as color fields (can be set easily by design time dialog)

Published property FieldsAsPassword: TStrings read FFieldsAsPassword write SetFieldsAsPassword;

Defines list of fields displayed and edited as password = hide chars

Published property FieldsAsDataBar: TStrings read FFieldsAsDataBar write SetFieldsAsDataBar;

Defines list of fields displayed as data bar (can be set easily by design time dialog)

Published property FieldsAsStatusBar: TStrings read FFieldsAsStatusBar write SetFieldsAsStatusBar;

Defines list of fields displayed as status bar (can be set easily by design time dialog)

Published property FieldsAutoPickList: TStrings read FFieldsAutoPickList write SetFieldsAutoPickList;

Defines list of fields with autopicklist function (can be set easily by design time dialog)

Published property FieldsDrawDropDown: TStrings read FFieldsDrawDropDown write SetFieldsDrawDropDown;

Defines list of fields with custom draw event of dropdown list (can be set easily by design time dialog)

Published property FieldsFilterButton: TStrings read FFieldsFilterButton write SetFieldsFilterButton;

Defines list of fields with filter button in Title Row (can be set easily by design time dialog)

Published property FieldsFilterMapping: TStrings read FFieldsFilterMapping write SetFieldsFilterMapping;

Defines mapping of the visible field with text filter (e.g. lookup field) to another field used for the filter condition

Published property FieldsFixedColumnWidth: TStrings read FFieldsFixedColumnWidth write SetFieldsFixedColumnWidth;

Defines list of fields with fixed column width, width is not changed by ColumnWidth property (can be set easily by design time dialog)

Published property TitlePopupItems: TStrings read FTitlePopupItems write SetTitlePopupItems;

Defines Popup Items for calculation of numeric fields, see rstring.pas for default values

Published property TitleExPopupMenu: TPopupMenu read FTitleExPopupMenu write SetTitleExPopupMenu;

Defines Popup Items for left top cell

Published property TitleMergedCellPopupMenu: TPopupMenu read FTitleMergedCellPopupMenu write SetTitleMergedCellPopupMenu;

Defines Popup Items for title groupped and merged cell

Published property TitleHints: TStrings read FTitleHints write SetTitleHints;

Defines title hints for each field (column) (can be set easily by design time dialog)

Published property TitleImageList: TImageList read FTitleImageList write SetTitleImageList;

link to ImageList for images in title rows

Published property TitleImages: TStrings read FTitleImages write SetTitleImages;

defines images in title row, can be set easily by design time dialog

Published property TitleButtons: TStrings read FTitleButtons write SetTitleButtons;

defines custom buttons in title row, OnTitleButtonClick is called (can be set easily by design time dialog)

Published property DataImageList: TImageList read FDataImageList write SetDataImageList;

link to ImageList for images in data cells

Published property DataImages: TStringList read FDataImages write SetDataImages;

defines images in data cells (can be set easily by design time dialog)

Published property FieldsGroups: TStringList read FFieldsGroups write SetFieldsGroups;

defines field groups (can be set easily by design time dialog)

Published property LookupListItemHeight: integer read FLookupListItemHeight write FLookupListItemHeight default 0;

defines absolute item height of lookup list, default is used if LookupItemHeight=0

Published property LookupListItemIncreaseHeight: integer read FLookupListItemIncreaseHeight write FLookupListItemIncreaseHeight default 2;

defines increase of standard item height of dropdown list

Published property LookupListItemIncreaseWidth: integer read FLookupListItemIncreaseWidth write FLookupListItemIncreaseWidth default 0;

defines increase of item column width

Published property OnCanEdit: TCanEditEvent read FOnCanEdit write FOnCanEdit;

event is called before editing of cell, set CanEdit to false to block editing of the cell

Published property OnChangeSort: TChangeSortEvent read FOnChangeSort write FOnChangeSort;

event is called after click on title row to provide sorting if Sorter component is not used; if "Accept" remains true, "SortFieldName" and "SortDesc" is changed and sort marker is shown, in other case nothing is changed; obsolete, use ChangeSortEventEx for multifield sorting

Published property OnChangeSortEx: TChangeSortEventEx read FOnChangeSortEx write FOnChangeSortEx;

Enhanced event with MultiField sorting supprt; event is called after click on title row to provide sorting if Sorter component is not used; if "Accept" remains true, "SortFieldName" and "SortDirections" is changed and sort marker is shown, in other case nothing is changed

Published property OnLinkClick: TLinkClickEvent read FOnLinkClick write FOnLinkClick;

event is called after click to user_defined hyperlink in the cell

Published property OnBoolClick: TLinkClickEvent read FOnBoolClick write FOnBoolClick;

event is called after click to checkbox in then cell

Published property OnTitleButtonClick: TLinkClickEvent read FOnTitleButtonClick write FOnTitleButtonClick;

event is called after click to title button in then title cell, Value contains button index

Published property OnTitleExClick: TNotifyEvent read FOnTitleExClick write FOnTitleExClick;

event is called after click to title ex (cell 0,0)

Published property OnFixColClick: TNotifyEvent read FOnFixColClick write FOnFixColClick;

event is called after click to fixed col cell (column 0)

Published property OnTitleMergedCellClick: TFooterCellClick read FOnTitleMergedCellClick write FOnTitleMergedCellClick;

event is called after click to merged cell of any group (use Column to find used group)

Published property OnTitlePopupItemClick: TNotifyEvent read FOnTitlePopupItemClick write FOnTitlePopupItemClick;

event is called after click to any menu item of the Title Popup

Published property OnFooterCellClick: TFooterCellClick read FOnFooterCellClick write FOnFooterCellClick;

event is called after click to footer cell

Published property OnGetFixedColState: TGetFixedColStateEvent read FOnGetFixedColState write FOnGetFixedColState;

event is called to get font and text of fixed column cell

Published property OnGetFixedRowState: TGetFixedRowStateEvent read FOnGetFixedRowState write FOnGetFixedRowState;

event is called to get font and text of fixed row cell (title cell)

Published property OnDrawTitleLine: TDrawTitleLineEvent read FOnDrawTitleLine write FOnDrawTitleLine;

event is called to get title line text or custom draw of title line directly

Published property OnDrawCellBackground: TDrawCellEvent read FOnDrawCellBackground write FOnDrawCellBackground;

event is called to draw cell background directly

Published property OnDrawTitleCellEnd: TDrawCellEvent read FOnDrawTitleCellEnd write FOnDrawTitleCellEnd;

event is called to add any custom draw of title cell directly

Published property OnDrawColumnCellEnd: TDrawColumnCellEvent read FOnDrawColumnCellEnd write FOnDrawColumnCellEnd;

event is called to add any custom draw of data cell directly

Published property OnDrawActiveRowFocus: TDrawColumnCellEvent read FOnDrawActiveRowFocus write FOnDrawActiveRowFocus;

event is called after cell draw to custom draw of focus rectange

Published property OnGetCellParams: TGetCellParamsEvent read FOnGetCellParams write FOnGetCellParams;

event is called to get params of data cell

Published property OnGetCellParamsEx: TGetCellParamsEventEx read FOnGetCellParamsEx write FOnGetCellParamsEx;

event is called to get params of data cell

Published property OnDrawFooterRow: TDrawFooterRowEvent read FOnDrawFooterRow write FOnDrawFooterRow;

event is called to draw whole footer row

Published property OnDrawFooterCell: TDrawFooterCellEvent read FOnDrawFooterCell write FOnDrawFooterCell;

event is called to draw one cell of footer row

Published property OnLoadPickList: TLoadPickListEvent read FOnLoadPickList write FOnLoadPickList;

event is called to load picklist for particular field - usually by aggregated query

Published property OnLoadFilterList: TLoadPickListEvent read FOnLoadFilterList write FOnLoadFilterList;

event is called to load filter bar list for particular field - usually by aggregated query

Published property OnLoadFunnelFilter: TLoadFunnelFilterEvent read FOnLoadFunnelFilter write FOnLoadFunnelFilter;

event is called to load funnel-filter list for particular field - usually by aggregated query

Published property OnGetHintStringEx: TGetHintStringEventEx read FOnGetHintStringEx write FOnGetHintStringEx;

event is called before showing of hint window to get user defined hint string

Published property OnRecalculateSummaryResult: TRecalculateSummaryResultEvent read FOnRecalculateSummaryResult write FOnRecalculateSummaryResult;

event is called to set all calculated values for one column (field), usually by some SQL query instead of record scan

Published property OnGetSummaryResult: TGetSummaryResultEvent read FOnGetSummaryResult write FOnGetSummaryResult;

event is called to update or format one particular calculated value of field (sum, min, max, avg ...)

Published property OnPickListDrawItem: TDrawItemEvent read FOnPickListDownItem write FOnPickListDownItem;

event is called to custom draw of PickList dropdowm item, FieldsDrawDropDown defines fields with dropdowm custom drawing

Published property OnPickListMeasureItem: TMeasureItemEvent read FOnPickListMeasureItem write FOnPickListMeasureItem;

event is called to get PickList dropdowm item height, FieldsDrawDropDown defines fields with dropdowm custom drawing

Published property OnPickListSetSize: Controls.TCanResizeEvent read FOnPickListSetSize write FOnPickListSetSize;

event is called to set size of PickList dropdown box

Published property OnGetLookupListItemHeight: TGetLookupListItemHeight read FGetLookupListItemHeight write FGetLookupListItemHeight;

event is called to set Lookup dropdown item height

Published property OnGetLookupListItemProps: TGetLookupListItemProps read FGetLookupListItemProps write FGetLookupListItemProps;

event is called to set Lookup dropdown item style or custom draw item

Published property OnGetEllipsisButtonFormat: TGetEllipsisButtonFormat read FOnGetEllipsisButtonFormat write FOnGetEllipsisButtonFormat;

event is called to define format of Ellipsis button in the cell

Published property OnTopLeftChanged: TNotifyEvent read FOnTopLeftChanged write FOnTopLeftChanged;

event is called after horizonal scrolling (first visible column is changed)

Published property OnDataScrolled: TNotifyEvent read FOnDataScrolled write FOnDataScrolled;

event is called after user scroll to another record

Published property BeforeScanDataset: TScanDatasetEvent read FBeforeScanDataset write FBeforeScanDataset;

event is called before dataset scan

Published property AfterScanDataset: TScanDatasetEvent read FAfterScanDataset write FAfterScanDataset;

event is called after dataset scan

Published property OnColWidthChanged: TColWidthChangedEvent read FOnColWidthChanged write FOnColWidthChanged;

event is called after changing of column width

Published property OnSetColumnFilter: TSetColumnFilterEvent read FOnSetColumnFilter write FOnSetColumnFilter;

event is called to custom setting of text filter for the column

Published property OnFilterChanged: TNotifyEvent read FFilterChanged write FFilterChanged;

event is called when dataset filter is activated, deactivated or changed, working only with using of funnel filter or rDBAction filter, setting filter directly to dataset do not fire this event

Published property OnFilterPanelButtonClick: TLinkClickEvent read FOnFilterPanelButtonClick write FOnFilterPanelButtonClick;

event is called after click to custom buttons in the filter footer panel, parameter Value contains button index

Published property OnRefreshData: TNotifyEvent read FOnRefreshData write FOnRefreshData;

event is not called by TrDBGrid, it is used by rDBAction only

Published property OnGeneralEvent: TGeneralEvent read FOnGeneralEvent write FOnGeneralEvent;

event is called in many events to add posibility of any custom code and to skip rest of the standard event


Generated by PasDoc 0.15.0.