Class: cCJGrid
cCJGrid
-------
Wraps the main grid control.
Class Hierarchy:
DFCOMACTIVEXCONTROL

cComActiveXControl


cCJReportControl



cCJGridDirect Known Subclasses:
cDbCJGrid, Class Definition
Properties
Boolean
pbAllowAppendRow
can append a row to the end
Boolean
pbAllowDeleteRow
can delete rows
Boolean
pbAllowInsertRow
can insert rows
Boolean
pbAutoAppend
append new rows when in add mode
Boolean
pbAutoSave
attempt save on row change
Boolean
pbBeginEditOnIdle
when set true, OnIdle will start edit-mode if appropriate
Boolean
pbEditOnTyping
Boolean
pbHeaderPrompts
click on header executes prompt if one exists
Boolean
pbHeaderReorders
click on header reorders
Boolean
pbHeaderSelectsColumn
click on header sets this as the selected column
Boolean
pbHeaderTogglesDirection
click on header changes order direction
Boolean
pbInRowFocusChanging
Boolean
pbNavigateOutOfEditMode
pbNavigateOutOfEditMode: Internal - Used to determine if the Tab, Shift Tab or Enter keys
were used to navigate out of a cell that was being edited. This property is used to stop
the navigated to cell from going into edit mode. See OnComRequestEdit.
Handle
pbNeedPostEntering
Boolean
pbNeedsRedraw
Boolean
pbNoFocusChangeCheck
Boolean
pbReadOnly
can change rows: in-place edit, save, delete, insert or append
Boolean
pbRestoreLayout
Boolean
pbSelectTextOnEdit
Determines if text is selected when cell goes into edit mode, see ReportRecordItemEditOptions.SelectTextOnEdit, we apply this setting to every column by default.
Boolean
pbUseFocusCellColors
draw focus cell background using piFocusCellBackColor & piFocusCellForeColor
Boolean
pbUseFocusCellRectangle
draw focus rectangle of selected cell. See piFocusCellRectangleColor.
Boolean
pbValidateOnNext
Boolean
pbVirtualMode
Integer
peGridMouseStatus
determines mouse down, up, moved status
Handle[]
phoColumnObjects
collection of report column objects
Handle
phoContextMenu
Handle
phoContextMenuColumn
column use for context menu
Handle
phoCustomEdit
Handle
phoDataSource
Object handle properties....................
cCJGridDataSource object
Handle
phoDeferredFocusColumn
Handle
phoFieldChooserPanel
Field Chooser tool panel object
Handle
phoHeaderContextMenu
Handle
phoIdleHandler
Handle
phoImageManagerIcons
Handle
phoPriorScopeFocus
Handle
phoReportColumn
Handle
phoReportColumns
Handle
phoReportNavigator
Handle
phoReportPaintManager
Handle
phoReportRecord
Handle
phoReportRecordItem
Handle
phoReportRecordItemMetrics
Handle
phoReportRecords
Handle
phoReportRow
Handle
phoReportRows
Handle
phoReportToolTipInfo
makes it easier to bind com objects
Handle
phoToolTipContext
Integer
piBeginEditLockCount
Integer
piCurrentEditColumn
tracks last column edited (including current edit)
Integer
piDefaultAlternateRowBackColor
Used to store the COM Object's default. This is a workaround as setting this COM property to -1 does not work.
Integer
piDeferredRemoveRow
Integer
piFocusCellBackColor
(RGB(217,222,243)) // Background color of the focused cell. clNone means that if pbSelectionEnable is true then piSelectedRowBackColor is used.
Integer
piFocusCellForeColor
clBlack // text color of the focused cell. clNone means that if pbSelectionEnable is true then piSelectedRowForeColor is used.
Integer
piFocusCellRectangleColor
pen color of the focused cell rectangle. See pbUseFocusCellRectangle
Integer
piLastImageId
Used to assign sequential image IDs in the ImageManagerIcons object
Integer
piLastKey
Integer
piLastKey2
Integer
piLastTopRowIndex
last topindex. Used to determine if scrolling in paint
Integer
piLastVisibleRowCount
last visible row count. Used to determine if scrolling in paint
Integer
piLayoutBuild
Integer
piSelectedColumn
Integer
piTooltipMarginBottom
Integer
piTooltipMarginLeft
Integer
piTooltipMarginRight
Integer
piTooltipMarginTop
Integer
piWatermarkTransparency
Internal: Used to set up the grid's watermark during OnCreate.
Integer
private_Color
see cReportPaintManager.BackColor
Boolean
private_Enabled_State
Gets or sets a value indicating whether the ReportControl can respond to user interaction., see ReportControl.Enabled
Boolean
private_pbAllowColumnRemove
Specifies whether ReportColumns can be removed from the ReportControl, see ReportControl.AllowColumnRemove
Boolean
private_pbAllowColumnReorder
Specifies whether ReportColumns can be reordered in the ReportControl, see ReportControl.AllowColumnReorder
Boolean
private_pbAllowColumnResize
Specifies whether ReportColumns can be resized, see ReportControl.AllowColumnResize
Boolean
private_pbAllowEdit
Allows the text in all ReportRecordItems to be edited, see cReportControl.AllowEdit.
Boolean
private_pbAutoColumnSizing
Specifies If AutoColumnSizing should be used. see ReportControl.AutoColumnSizing
Boolean
private_pbDrawGridForEmptySpace
Gets or sets wether grid lines will be drawn after the body of rows to fill the empty space. See ReportPaintManager.DrawGridForEmptySpace.
Boolean
private_pbEditOnClick
Determine whether a ReportRecorditem can be edited by single-clicking on the item., see ReportControl.EditOnClick
Integer
private_pbEditOnKeyNavigation
Integer
private_pbFixedInplaceButtonHeight
Specifies whether the paint manager supports fixed height of in-place buttons, see ReportControl.FixedInplaceButtonHeight
Integer
private_pbFocusSubItems
Boolean
private_pbFullColumnScrolling
Specifies whether full column scrolling will be used., see ReportControl.FullColumnScrolling
Boolean
private_pbGrayIfDisable
Specifies whether to draw the report using "normal" colors or standard Windows disabled colors when the report control disabled. See ReportPaintManager.GrayIfDisable.
Boolean
private_pbHideSelection
Determines whether the currently selected rows will remain shaded when the ReportControl loses focus. See ReportPaintManager.HideSelection.
Boolean
private_pbHotTracking
Gets\Set whether hot tracking is used While moving the mouse over the column header when using the "Explorer" or "Office 2003" column styles. See ReportPaintManager.HotTracking.
Boolean
private_pbInitialSelectionEnable
Specifies whether the first row in the report will become selected when initially populated., see ReportControl.InitialSelectionEnable
Boolean
private_pbMultipleSelection
Specifies whether multiple ReportRows can be selected at the same Time in the grid, see cReportControl.MultipleSelection
Boolean
private_pbMultiSelectionMode
Enables/disables the multiple selection mode for the control., see ReportControl.MultiSelectionMode
Boolean
private_pbReverseOrdering
current direction of ordering
Boolean
private_pbSelectionEnable
Gets or sets whether rows will become selected when clicked or navigated with the arrow keys., see ReportControl.SelectionEnable
Boolean
private_pbShadeSortColumn
Boolean
private_pbShowFooter
Shows\Hides the report column footer., see ReportControl.ShowFooter
Boolean
private_pbShowHeader
The ShowHeader Property is used to hide or display the Column Headers in the Report Control., see ReportControl.ShowHeader
Boolean
private_pbShowNonActiveInPlaceButton
Specifies whether to Show NonActive InPlace Buttons (Combo, Expand, Spin) all the Time. See ReportPaintManager.ShowNonActiveInPlaceButton.
Boolean
private_pbShowRowFocus
Specifies whether to draw a focus rectangle around the focused row, see cReportControl.ShowRowFocus
Boolean
private_pbUseAlternateRowBackgroundColor
Specifies whether to use the piAlternateRowBackgroundColor to color the background of every second row. See ReportPaintManager.UseAlternativeBackground.
Boolean
private_pbUseColumnTextAlignment
The UseColumnTextAlignment Property specifies whether the text in the column header will Use the ReportColumn.Alignment setting to align the header caption. See ReportPaintManager.UseColumnTextAlignment.
Boolean
private_pbUseEditTextAlignment
Specifies whether the ReportColumn.Alignment setting is automatically applied to items when in edit mode. See ReportPaintManager.UseEditTextAlignment.
XTPReportBorderStyle
private_peBorderStyle
The type of border style that is placed around the ReportControl, see ReportControl.BorderStyle
XTPReportColumnStyle
private_peColumnStyle
Stores the style used to display ReportColumn headers. See ReportPaintManager.ColumnStyle.
XTPReportDrawSortTriangleStyle
private_peDrawSortTriangleStyle
XTPReportFreezeColsDividerStyle
private_peFreezeColsDividerStyle
Style of the freeze column divider. See ReportPaintManager.FreezeColsDividerStyle.
XTPReportGridStyle
private_peHorizontalGridStyle
Style used to draw horizontal grid lines. See ReportPaintManager.HorizontalGridStyle.
XTPToolTipStyle
private_peTooltipStyle
The Style Property gets\sets the style of the tool tip window. See TooltipContext.Style
XTPReportGridStyle
private_peVerticalGridStyle
see cReportPaintManager.VerticalGridStyle
XTPReportWatermarkAlignment
private_peWatermarkAlignment
Gets or sets the alignment of the watermark., see ReportControl.WatermarkAlignment
Integer
private_piAlternateRowBackgroundColor
The background color of every second grid row. See ReportPaintManager.AlternativeBackgroundColor
Integer
private_piCaptionBackColor
The background color of the column headers. See ReportPaintManager.CaptionBackColor.
Integer
private_piCaptionBackGradientColorDark
The "Dark" color in the color gradient used for the background color of "normal" column headers. See ReportPaintManager.CaptionBackGradientColorDark.
Integer
private_piCaptionBackGradientColorLight
The "Light" color in the color gradient used for the background color of "normal" column headers. See ReportPaintManager.CaptionBackGradientColorLight.
Integer
private_piCaptionForeColor
The forecolor\caption color of the column headers. See ReportPaintManager.CaptionForeColor.
Integer
private_piColumnHotGradientColorDark
The "Dark" color in the color gradient used for the background color of "hot" column headers. See ReportPaintManager.ColumnHotGradientColorDark.
Integer
private_piColumnHotGradientColorLight
The "Light" color in the color gradient used for the background color of "hot" column headers. See ReportPaintManager.ColumnHotGradientColorLight.
Integer
private_piColumnPushedGradientColorDark
The "Dark" color in the color gradient used for the background color of "pushed" column headers. See ReportPaintManager.ColumnPushedGradientColorDark.
Integer
private_piColumnPushedGradientColorLight
The "Light" color in the color gradient used for the background color of "pushed" column headers. See ReportPaintManager.ColumnPushedGradientColorLight.
Integer
private_piFreezeColsDividerColor
Color of the freeze column divider. See ReportPaintManager.FreezeColsDividerColor.
Integer
private_piFreezeColumnsCount
Gets\Sets the Number of columns that are frozen when the report is scrolled horizontally., see ReportControl.FreezeColumnsCount
Integer
private_piGridLineColor
The color used to draw grid lines. See ReportPaintManager.GridLineColor.
Integer
private_piHeaderHeightMultiplier
number of fixed header rows (overrides cCJGridColumn.pbMultiLine), -1 or 0 = ignore.
Integer
private_piHighlightBackColor
The background color of selected rows. See ReportPaintManager.HighlightBackColor.
Integer
private_piHighlightForeColor
The text color of selected rows. See ReportPaintManager.HighlightForeColor.
Integer
private_piHotDividerColor
Gets\sets the color of the arrows used to Show where a column can be dropped when dragging a column header. See ReportPaintManager.HotDividerColor.
Integer
private_piHScrollStep
Gets\sets the amount of pixels the report is scrolled when the horizontal scroll bar buttons are clicked., see ReportControl.HScrollStep
Integer
private_piSelectedRowBackColor
The background color of selected rows when grid doees not have the focus. See ReportPaintManager.SelectedRowBackColor.
Integer
private_piSelectedRowForeColor
The text color of selected rows when grid does not have the focus. See ReportPaintManager.SelectedRowForeColor.
Integer
private_piSelectedTextColor
color of the selected cell's text. This is maintained in OnComBeforeDrawRow.
Integer
private_piShadeSortColor
Default sorted column background. see cReportPaintManager.ShadeSortColor
Integer
private_piSortColumn
tracks current sort column
Integer
private_piTooltipBkColor
Gets\sets the background color of the tool tip window. See TooltipContext.TipBkColor
Integer
private_piTooltipMaxWidth
The MaxTipWidth Property gets\sets the maximum tool tip width in pixels. See TooltipContext.MaxTipWidth
Integer
private_piTooltipTextColor
Gets\sets the color of the text that is displayed in the tool tip window. See TooltipContext.TipTextColor
String
private_psNoFieldsAvailableText
The "No Fields Available" text message displayed in the Field Chooser when no Column Headers are present. See ReportPaintManager.NoFieldsAvailableText.
String
private_psNoItemsText
The "No Items" text message displayed in the ReportControl when there are no visible rows. See ReportPaintManager.NoItemsText.
Variant
private_pvSelectedFont
COM object pointer of the selected cell's Font. This is maintained in OnComBeforeDrawRow.
Integer
private_TextColor
Default grid text color. see cReportPaintManager.ForeColor
String
psInstanceLayout
String
psLayoutSection
the developer must provide a unique string id for this.
String
psOriginalLayout
String
psWatermark
Internal: Used to set up the grid's watermark during OnCreate.
Functions and Procedures
Integer
Activate()
augmented to set a flag which tells the idle handler to go into edit mode at the end
of its processes. This is needed so that the grid edit control takes the focus when it is first
activated and when switching between views.

ActivateFieldChooser()
ActivateFieldChooser:
Send this message to popup a field chooser object.
Integer
AddImage(String sImage Integer iId)
AddImage
Adds an image to imagelist.
We assume that this is an icon unless the .bmp extension is passed.
return True if success
Integer
AddImageType(Boolean bIsIcon String sImage Integer iId)
AddImageType:
Adds an image to imagelist. Pass if bmp or icon, the image name and the Id and image type (normal, disabled, etc.)
With Bitmaps this will first look for the resource then search for the file in the file path.
With Icons it checks for the file first (explained below)
return Image Id if success
Boolean
AddRow(Integer iNewRow)
inserts or appends a new empty row at iNewRow
Pass row number to insert before. If at end, it will append
Existing row is restored or saved as needed with verifications
Returns True if this was cancelled (eitehr not allowed or a verification cancel)

AllowMultiLineCells()
AllowMultiLineCells
Send this message to enable multi line cells in the grid. (usually this message is sent by a column object
when it's pbMultiLine property is set to true.

AttachFieldChooser(Handle hoFieldChooser Boolean bAttach)
AttachFieldChooser
Send this message to attach a field chooser object to the Grid. See ReportControl.FieldChooser
hoFieldChooser - is the object handle of the cCJGridFieldChooser control. The field chooser's COM object
should be already created before sending this message.

BeginEdit()
starts edit mode if not already in edit mode

BeginEditOnIdle()
OnIdle is done and needs to check if the edit control should take the focus.
We set the focus if pbBeginEditOnIdle is true (set by activate) and the grid has
the focus. ResetEditMode may not activate the edit control. This only does something if
pbEditOnNavigate/pbEditOnClick is true (i.e., aggressive edit mode)

BindDataSource()
use this to set any special properties in the datasource that might be
needed for this particular grid and data source
Boolean
CanAddRow()
returns true if you are allowed to insert a row
Boolean
CanCopy()
CanCopy
Indicates whether a Copy operation can be performed., see ReportControl.CanCopy
Boolean
CanCut()
CanCut
Indicates whether a Cut operation can be performed., see ReportControl.CanCut
Boolean
CanDeleteRow()
returns true if you are allowed to delete the row
Boolean
CanEditColumn(Integer iCol)
This is called by OnComRequestEdit which means that this is already
editable. This is used as one last chance to stop the edit. Most often
this will be applied to the entire row. We will disable edits if pbReadOnly is True.
When pbReadOnly is true and pbAllowEdit is true (default) edit requests will come
here and we want to disable them. If for some odd reason you wanted to be able to
edit you could augment this message
Boolean
CanPaste()
CanPaste
Indicates whether a Paste operation can be performed., see ReportControl.CanPaste
Boolean
CanSaveRow()
returns true if you are allowed to save the row
Integer
Color()
Boolean
ColumnChange(Integer iNew)
changes the column

ColumnChanged(Integer iOld Integer iNew)
this provides room for us to work within
Boolean
ColumnChanging(Integer iOld Integer iNew)
this provides room for us to work within
Integer
ColumnCount()
returns number of columns
Handle
ColumnObject(Integer iColumn)
returns object for column
Handle[]
ColumnObjectsInDisplayOrder()
ColumnObjectsInDisplayOrder
return array of column objects in display order.
This will include non visible objects so you may have to test if the object is visible

CommitFocusField()
Sent to commit the value in an edit control without
needing to close the edit
Boolean
CommitSelectedRow()
this does a commit of the selected row without changing the
actual row. Can be used to save or clear a row without changing the row. If the
row is new and not changed we will remove it. This is normally used in exiting.

ComRedraw()

Construct_Object()
Integer
ConvertSystemColor(Integer iColor)
------------------------------------------------------------------------
Methods.................................................................
------------------------------------------------------------------------

CreateColumns()
Handle
CreateContextMenu()
CreateContextMenu
Called by constructor to create a regular context grid menu. Can be augmented
create a different object or none at all. By default this creates nothing
Boolean
CreateDataSource()
CreateDataSource
Called by constructor to create a datasource
Handle
CreateFieldChooserPanel()
CreateFieldChooserPanel
Called by constructor to create a field chooser panel. Can be augmented
create a different object or none at all

CreateGridControl()
Handle
CreateHeaderContextMenu()
CreateHeaderContextMenu
Called by constructor to create a header context menu. Can be augmented
create a different object or none at all
Handle
CreatePropExchangeObject()
create and return a PropExchange COM object

CreateTemplateRow()
create a template row
Integer
Current_Item()
required Item interface
These are special item/value things that get sent to the focus
object to get or set the current focused control).
required Item interface
String
CurrentLayoutAsXML()
return the current layout as an xml document. We use this instead of ComLoadSettings & ComSaveSettings
because those interfaces don't work as well. When two columns have the same name, it messes things up.

DeferredRedraw()
tells grid to redraw when idle
Boolean
DeleteSelectedRow()
deletes the selected row from datasource with verify
returns true if cancelled (either not allowed or cancelled)

DestroyColumnObjects()
Destroys all column objects. You'd only use this if you are dynamically creating columns. There is no need to send
this during a normal grid destroy. There is no option to destroy individual columns - just destroy them all and start over.
This also resets the datasource. The datasource is not valid when the column objects are destroyed.
String
EditValue()
returns the current value from the active edit control
Integer
Enabled_State()

EndEdit()
ends edit mode. If not in edit mode, does nothing
Integer
Entering()

EnteringGrid()
Integer
EstimateVisibleRowCount(Handle hoRow Variant llItem)
Must be called from BeforeDrawRow passing the row object and recorditem com pointer.
If variable length row, we change to guess.

ExchangeLayout(Handle hoExchange String sSection)
does a property exchange. Pass COM exchange objetc and section name
Integer
Exiting(Handle hoDestination)
it is important that the exiting logic is executed properly, particularly the
custom edit cancellation. For that reason developers are discouraged from augmenting
this method and OnExiting is provided instead
Handle
FirstEnterableColumn()
returns the first enterable column object, 0 if none
Boolean
ForceColumnExit()
Does a column exit without changing the current column.
Is used to force the column exiting events without changing
the column (used during object exiting)

FreezeColumn(Handle hoCol)

GetCustomEditSizeAndLocation(Handle hoRow Variant llItem Integer ByRef iSizeY Integer ByRef iSizeX Integer ByRef iLocY Integer ByRef iLocX)
this returns by reference the GUI size and location for the edit control.
Integer
GetFocusedColumnIndex()
get index of focused column. Use carefully. You should use SelectedColumn.
This returns the object item order not display order
Integer
GetFocusedRowIndex()
// Sets focused row but does not adjust datasource. Use with care!
Procedure SetFocusedRow Integer iIndex
Variant vRow vrows
Handle horows
Get phoReportRows to horows
Get ComRows to vrows
Set pvComObject of horows to vRows
Get ComRow of horows iIndex to vRow
// setting focused row changes the displayed row and sets selection
Set ComFocusedRow to vRow // set focused row
End_Procedure
get index of focused row. Use carefully. You should use SelectedRow
Integer[]
GetIndexesForSelectedRows()
Get array of selected rows. This is not to be confused with
with the Grid's SelectedRow. These are rows that are selected
Integer
GetSelectedRowsCount()
Get number of selected rows. Normally not needed as GetIndexesForSelectedRows
has the same info.
Integer
GetVKeyToAnsi(Integer iVKey Integer iShiftBits)
convert current key press from keydown to ANSI character. Returns 0 in a char

HeaderReorder(Integer iCol)
request a grid reorder based on bestorder for this header column.

InitializeData(Variant[] DataSource)
initializes the data
Boolean
IsBeginEditLocked()
Boolean
IsCustomEditMode()
returns true if VDF edit control is active
Boolean
IsEditMode()
returns true if built-in or VDF edit control is active
Integer
Item_Changed_State(Integer iItem)
required Item interface
always returns values
Integer
item_count()
required Item interface
Handle
ItemToColumnObject(Integer iItem)
required DD/DEO interface
Handle
LastEnterableColumn()
returns the last enterable column object, 0 if none

LoadEnvironment()
Standard LoadEnvironment Behavior.
This is good for augmentation if you wish to change the standard load.
Boolean
LoadFirstOrLastRow(Boolean bLast)
Boolean
LoadGridLayoutFromRegistry(String sKey)
loads grid info from the registry.
It provides a good model for how to do this kind of thing.

LockBeginEdit()

MoveDownRow()
used by down arrow key. Does a row down with the option of
creating a new row at the bottom.

MovePageDown()

MovePageUp()
Boolean
MoveToColumnObject(Handle hoCol)
MoveToColumnObject
Move to the column and set SelectedColumn.

MoveToFirstEnterableColumn()
move to first enterable column

MovetoFirstRow()
Move to first row and select. This is the last row of data, which may not
be the first row of the current datasource. Can be used to refresh the grid
around the first record

MoveToLastEnterableColumn()
move to last enterable column

MovetoLastRow()
Move to last row and select. This is the last row of data, which may not
be the last row of the current datasource. Can be used to refresh the grid
around the last record

MoveToRow(Integer iIndex)
Move to a row.

MoveUpRow()
used by up arrow key. Does a row up

NewColumn(Integer iColumn)
Selects column without entering exiting messages.
Note that this sets SelectedColumn but it does not synch this with
the grid's focus column. If you misuse this, things will not work

Next()
Next

Notify_Focus_Change(Integer Fg)

NotifyCustomEndEdit(Integer iCol String sValue)

NotifyEndEdit(Integer iRow Integer iColumn String sValue)

NotifyItemChecked(Integer iRow Integer iColumn)
Integer
OffSetFromTop()
returns number of rows the selectedRow is from the TopRow. If SelRow is
above, the top, it returns 0.

OnComBeforeDrawRow(Variant llRow Variant llItem Variant llMetrics)
OnComBeforeDrawRow

OnComColumnOrderChangedEx(Variant llColumn XTPReportColumnOrderChangedReason llReason)
OnComColumnOrderChangedEx
augmented so we know that a header click did resulted in some kind of column move. When this happens
we don't want to treat a mouse up as a simple mouse click

OnComDrawItem(Variant llRow Variant llColumn Variant llItem OLE_HANDLE hDC Integer iLeft Integer iTop Integer iRight Integer iBottom Boolean ByRef llDoDefault)
OnComDrawItem
Augmented to draw a rectangle around the "focused cell".

OnComFocusChanging(Variant llNewRow Variant llNewColumn Variant llNewItem Boolean ByRef llCancel)
OnComFocusChanging
use this to synch the focus row with the datasource's selectrow
Thi gets called first to move to column (if needed) and then it is called to move the row (if needed). If col
is canceled, it is called to mvoe the row with the current column.

OnComGetToolTipInfo(Variant lltoolTipInfo)
OnComGetToolTipInfo
Send tooltip event to the appropriate column object.

OnComItemCheck(Variant llRow Variant llItem)
OnComItemCheck

OnComKeyDown(Short ByRef llKeyCode Short llShift)
OnComKeyDown

OnComMouseDown(Short llButton Short llShift Integer llx Integer lly)
OnComMouseDown
augmented to set internal property to false, which may get reset in OnComColumnOrderChangedEx

OnComMouseUp(Short llButton Short llShift Integer llx Integer lly)
OnComMouseUp
augment to handle mouse header click

OnComPreviewKeyDown(Short ByRef iKeyCode Short iShift Boolean ByRef bCancel)
OnComPreviewKeyDown
Handle keyboard navigation duties. Triggered after a key is pressed down but before it is processed.

OnComRequestEdit(Variant llRow Variant llColumn Variant llItem Boolean ByRef llCancel)

OnComRowDblClick(Variant llRow Variant llItem)
Augmented to send OnRowDoubleClick

OnComRowRClick(Variant llRow Variant llItem)
OnComRowRClick
Augmented to handle popping up a context menu....

OnComValueChanged(Variant llRow Variant llColumn Variant llItem)
OnComValueChanged

OnCreate()
OnCreate
Called when the COM object is created.
make this private. Use OnCreateGridControl for custom event

OnCreateGridControl()
OnCreateGridControl

OnEntering()

OnEnterKey()

OnEscKey()
Boolean
OnExiting(Handle hoDestination)

OnHeaderClick(Integer iCol)

OnHeaderRightClick(Integer iCol)
OnHeaderRightClick
Handle poping up a header context menu

OnIdle()
OnIdle
Boolean
OnPostEntering()

OnRelease()
OnRelease

OnRowChanged(Integer iOldRow Integer iNewSelectedRow)
called after the row change has succeeded. iNewSelectedRow is now the SelectedRow
Boolean
OnRowChanging(Integer iCurrentSelectedRow Integer iNewRow)
called before row change. iCurrentSelectedRow is the SelectedRow. Return True to cancel

OnRowDoubleClick(Integer iRow Integer iCol)

OnRowRightClick(Integer iRow Integer iCol)
Handle popping up a context menu over a row

OnUnknownAreaClick(Integer iX Integer iY)
Handle popping up a click in an unknown area. If autoappend is allowed we will attempt to append
a row to the end of the table. This can be easily cancelled.

OnWrappingRow(Boolean bForwardWrap Handle hoToColumn Boolean ByRef bWrapRow Boolean ByRef bCancel)
When next or previous results in a wrap you can choose to cancel (set bCancel True)
stay within the row (set bWrapRow to False) or activate some other object, row, or column
(just do it and set bCancel True)

PageData(Integer iStartRow)
normally sent within BeforeDraw Paint event. The startrow is the top row and last row must be the
approximate last row (so we have number of rows by subtracting the two). Any special caching (and there is some)
will be handled by PageInRows in the datasource
Boolean
pbAllowColumnRemove()
Boolean
pbAllowColumnReorder()
Boolean
pbAllowColumnResize()
Boolean
pbAllowEdit()
Boolean
pbAutoColumnSizing()
Boolean
pbDrawGridForEmptySpace()
Boolean
pbEditOnClick()
Boolean
pbEditOnKeyNavigation()
Boolean
pbFixedInplaceButtonHeight()
Boolean
pbFocusSubItems()
Boolean
pbFullColumnScrolling()
Boolean
pbGrayIfDisable()
Boolean
pbHideSelection()
Boolean
pbHotTracking()
Boolean
pbInitialSelectionEnable()
Boolean
pbMultipleSelection()
Boolean
pbMultiSelectionMode()
Boolean
pbReverseOrdering()
Boolean
pbSelectionEnable()
Boolean
pbShadeSortColumn()
Boolean
pbShowFooter()
Boolean
pbShowHeader()
Boolean
pbShowNonActiveInPlaceButton()
Boolean
pbShowRowFocus()
Boolean
pbUseAlternateRowBackgroundColor()
Boolean
pbUseColumnTextAlignment()
Boolean
pbUseEditTextAlignment()
XTPReportBorderStyle
peBorderStyle()
XTPReportColumnStyle
peColumnStyle()
XTPReportDrawSortTriangleStyle
peDrawSortTriangleStyle()
XTPReportFreezeColsDividerStyle
peFreezeColsDividerStyle()
XTPReportGridStyle
peHorizontalGridStyle()
XTPToolTipStyle
peTooltipStyle()
XTPReportGridStyle
peVerticalGridStyle()
XTPReportWatermarkAlignment
peWatermarkAlignment()
Integer
piAlternateRowBackgroundColor()
Integer
piCaptionBackColor()
Integer
piCaptionBackGradientColorDark()
Integer
piCaptionBackGradientColorLight()
Integer
piCaptionForeColor()
Integer
piColumnHotGradientColorDark()
Integer
piColumnHotGradientColorLight()
Integer
piColumnPushedGradientColorDark()
Integer
piColumnPushedGradientColorLight()
Integer
piFreezeColsDividerColor()
Integer
piFreezeColumnsCount()
Integer
piGridLineColor()
Integer
piHeaderHeightMultiplier()
Integer
piHighlightBackColor()
Integer
piHighlightForeColor()
Integer
piHotDividerColor()
Integer
piHScrollStep()
Integer
piSelectedRowBackColor()
Integer
piSelectedRowForeColor()
Integer
piShadeSortColor()
Integer
piSortColumn()
Integer
piTooltipBkColor()
Integer
piTooltipMaxWidth()
Integer
piTooltipTextColor()

PostEntering()
This is called after a focus change is complete during the first idle event
It sends OnEntering which can be cancelled. If cancelled the prior focus object
will be activated. However, if OnEntering changed the focus, it won't do anything

Previous()

Prompt()
Does a prompt for selected column. Needed by the rest of the system

Prompt_Callback(Handle hoPrompt)
Handle
Prompt_Object()
returns prompt object for selected column. Needed by the rest of the system
String
psNoFieldsAvailableText()
String
psNoItemsText()

RegisterColumn(Handle hoColumn)
RegisterColumn:
Registers a column object in the columns collection.

ReInitializeData(Variant[] DataSource Boolean bKeepSelections)
reinitialize the static data in your grid. This is meant to be used where
you have taken the datasource and made a batch change like setting all checkboxes
in a column. The restores the current row, column and selections. This works best
if you keep the same number of rows. If you add or delete rows below the selected row
it will work ok. If you insert rows or delete records above the selected rows you
don't want to use this - Use InitializeData

ReleaseComObject()
Boolean
RemoveNewSelectedRow()
removes a new selected row and selects the next row
performs a dataloss verify if needed.
Returns True If canceled

RemoveRowAndSelect(Integer iRow)
Removes the row, the row below becomes the selected row unless there are no
rows below and then the row above is selected.
If other rows were selected they are deselected

Request_AppendRow()
requests an append row

Request_Cancel()

Request_Clear()
standard request_clear (which is sent to all DEOs).
Does a Request_ClearRow

Request_ClearRow()
Request a "clear row"
This is the table row clearing handler. If:
A. New row / Unchanged: Delete empty row
B. old row / unchanged: ignore
C. New row / changed: verify_loss and clear changes, goto 1st enterable column
D. old row / changed: verify_loss and clear changes, goto 1st enterable column

Request_Delete()
request a delete row
delete row and back end record.
If the record is new, treat this as a remove row request

Request_InsertRow()
requests an insert row

Request_Save()
request a save

Request_Search(Integer iKeyCode Integer iKeyShift)
do a popup search request for the sort column. The keys can provide a
seed value - they come from OnComKeyDown

Request_Status_Help(Boolean bShow)
request status help. First check if their is a column help string
if not, see if the grid has a help string.

RequestColumnSearch(Handle hoCol Integer iKeyCode Integer iKeyShift)
do a popup search request for the passed column. The keys can provide a
seed value - they come from OnComKeyDown

RequestFindColumnValue(Integer iColumn String sValue Boolean bFindGE Integer iStartRow)
Search the value for this column in the datasource and move to that row.
This is meant to be used when all data is loaded. bFindGE determines if this is a EQ (false)
or GE (True) find. iStartRow determines the row to start the search at.
If a GE search and no match move to end of datasource (it makes the most sense)

ResetEditMode(Boolean bWasEdit)

ResetGrid()
does a reset. Clears data. Add columns to datasource

ResetVirtualMode(Integer iCount)
this does the mechanics of resetting info for virtual mode. Note that after
a reset, everything is cleared, Although focusRow is 0, we are setting select row as not defined

RestoreLayout()
restores the gird layout with the original object created layout.
It is an error to call this when the grid is not activated.

RestoreLayoutFromXMLString(String sXmlLayout)
restore the grid based on the passed xml layout string.
Boolean
RestoreSelectedRow()
restores the selected row back to its pre-edited state
performs a dataloss verify if needed
returns True if canceled

ReSynchToDataSource()
called to reset datasource rowcount/offset as needed and then
update the report control
Boolean
RowChange(Integer iNew)
RowChange
handles possible row change. returns false to cancel
Boolean
RowChanging(Integer iOld Integer iNew)

SaveEnvironment()
Standard SaveEnvironment Behavior. This is called when the grid is deactivated.
This is good for augmentation if you wish to change the standard save

SaveGridLayoutToRegistry(String sKey)
save grid info to the registry.
It provides a good model for how to do this kind of thing.
Boolean
SaveSelectedRow()
Save the selected row with verify
returns True if cancelled (either not allowed or cancelled)
Integer
SelectedColumn()
SelectedColumn
Call this to get the index of the currently focused column.
Handle
SelectedColumnObject()
returns selected column object, 0 if none

Set(Integer iValue)
------------------------------------------------------------------------
Property Get/Set Methods................................................
------------------------------------------------------------------------
Color
The background color of the grid, see ReportPaintManager.BackColor

Set(Integer bValue)
Enabled_State
Augmented to set/return ReportControl.Enabled

Set(Boolean bValue)
pbAllowColumnRemove
Specifies whether ReportColumns can be removed from the ReportControl, see ReportControl.AllowColumnRemove

Set(Boolean bValue)
pbAllowColumnReorder
Specifies whether ReportColumns can be reordered in the ReportControl, see ReportControl.AllowColumnReorder

Set(Boolean bValue)
pbAllowColumnResize
Specifies whether ReportColumns can be resized, see ReportControl.AllowColumnResize

Set(Boolean bValue)
pbAllowEdit:
Allows the text in all cells to be edited by default. see cReportControl.AllowEdit

Set(Boolean bValue)
pbAutoColumnSizing
Specifies If AutoColumnSizing should be used, see ReportControl.AutoColumnSizing

Set(Boolean bValue)
pbDrawGridForEmptySpace
Gets or sets wether grid lines will be drawn after the body of rows to fill the empty space. See ReportPaintManager.DrawGridForEmptySpace.

Set(Boolean bValue)
pbEditOnClick
Determine whether a ReportRecorditem can be edited by single-clicking on the item., see ReportControl.EditOnClick

Set(Boolean bValue)
pbFixedInplaceButtonHeight
Specifies whether the paint manager supports fixed height of in-place buttons, see ReportControl.FixedInplaceButtonHeight

Set(Boolean bValue)
pbFocusSubItems:
If True, when a cell is clicked, the entire row will become highlighted except the individual cell that was clicked.
If False, the entire row will become highlighted when an item is clicked, including the item that was clicked.
Also controls the ability of the grid control to address individual cells.
See cReportControl.FocusSubItems

Set(Boolean bValue)
pbFullColumnScrolling
Specifies whether full column scrolling will be used., see ReportControl.FullColumnScrolling

Set(Boolean bValue)
pbGrayIfDisable
Specifies whether to draw the report using "normal" colors or standard Windows disabled colors when the report control disabled. See ReportPaintManager.GrayIfDisable.

Set(Boolean bValue)
pbHideSelection
Determines whether the currently selected rows will remain shaded when the ReportControl loses focus. See ReportPaintManager.HideSelection.

Set(Boolean bValue)
pbHotTracking
Gets\Set whether hot tracking is used While moving the mouse over the column header when using the "Explorer" or "Office 2003" column styles. See ReportPaintManager.HotTracking.

Set(Boolean bValue)
pbInitialSelectionEnable
Specifies whether the first row in the report will become selected when initially populated., see ReportControl.InitialSelectionEnable

Set(Boolean bValue)
pbMultipleSelection:
Specifies whether multiple rows can be selected at the same time, see cReportControl.MultipleSelection

Set(Boolean bValue)
pbMultiSelectionMode
Enables/disables the multiple selection mode for the control., see ReportControl.MultiSelectionMode

Set(Boolean bValue)
pbSelectionEnable
Gets or sets whether rows will become selected when clicked or navigated with the arrow keys., see ReportControl.SelectionEnable

Set(Boolean bValue)
pbShowNonActiveInPlaceButton
Specifies whether to Show NonActive InPlace Buttons (Combo, Expand, Spin) all the Time. See ReportPaintManager.ShowNonActiveInPlaceButton.

Set(Boolean bValue)
pbShowRowFocus:
Specifies whether to draw a focus rectangle around the focused row, see cReportControl.ShowRowFocus

Set(Boolean bValue)
pbShowFooter
Shows\Hides the report column footer., see ReportControl.ShowFooter

Set(Boolean bValue)
pbShowHeader
The ShowHeader Property is used to hide or display the Column Headers in the Report Control., see ReportControl.ShowHeader

Set(Boolean bValue)
pbEditOnKeyNavigation
Determines the behavior of Tab Key Navigation. When False, the default Grid control behavior is applied. When True,
the appication can trap the Tab key to alter its behavior.
See cReportControl.TrapTabKey

Set(Boolean bValue)
pbUseAlternateRowBackgroundColor
Specifies whether to use the piAlternateRowBackgroundColor to color the background of every second row. See ReportPaintManager.UseAlternativeBackground.

Set(Boolean bValue)
pbUseColumnTextAlignment
The UseColumnTextAlignment Property specifies whether the text in the column header will Use the ReportColumn.Alignment setting to align the header caption. See ReportPaintManager.UseColumnTextAlignment.

Set(Boolean bValue)
pbUseEditTextAlignment
Specifies whether the ReportColumn.Alignment setting is automatically applied to items when in edit mode. See ReportPaintManager.UseEditTextAlignment.

Set(XTPReportBorderStyle eValue)
peBorderStyle
The type of border style that is placed around the ReportControl, see ReportControl.BorderStyle

Set(XTPReportColumnStyle iValue)
peColumnStyle
Stores the style used to display ReportColumn headers. See ReportPaintManager.ColumnStyle.

Set(XTPReportFreezeColsDividerStyle iValue)
peFreezeColsDividerStyle
Style of the freeze column divider. See ReportPaintManager.FreezeColsDividerStyle.

Set(XTPReportGridStyle iValue)
peHorizontalGridStyle:
Style used to draw horizontal grid lines. See ReportPaintManager.HorizontalGridStyle.

Set(XTPToolTipStyle iValue)
peTooltipStyle
The Style Property gets\sets the style of the tool tip window. See TooltipContext.Style.

Set(XTPReportGridStyle iValue)
peVerticalGridStyle:
Style used to draw vertical grid lines, see cReportPaintManager.VerticalGridStyle

Set(XTPReportWatermarkAlignment eValue)
peWatermarkAlignment
Gets or sets the alignment of the watermark., see ReportControl.WatermarkAlignment

Set(Integer iValue)
piAlternateRowBackgroundColor
The background color of every second grid row. See ReportPaintManager.AlternativeBackgroundColor

Set(Integer iValue)
piCaptionBackColor
The background color of the column headers. See ReportPaintManager.CaptionBackColor.

Set(Integer iValue)
piCaptionBackGradientColorDark
The "Dark" color in the color gradient used for the background color of "normal" column headers. See ReportPaintManager.CaptionBackGradientColorDark.

Set(Integer iValue)
piCaptionBackGradientColorLight
The "Light" color in the color gradient used for the background color of "normal" column headers. See ReportPaintManager.CaptionBackGradientColorLight.

Set(Integer iValue)
piCaptionForeColor
The forecolor\caption color of the column headers. See ReportPaintManager.CaptionForeColor.

Set(Integer iValue)
piColumnHotGradientColorDark
The "Dark" color in the color gradient used for the background color of "hot" column headers. See ReportPaintManager.ColumnHotGradientColorDark.

Set(Integer iValue)
piColumnHotGradientColorLight
The "Light" color in the color gradient used for the background color of "hot" column headers. See ReportPaintManager.ColumnHotGradientColorLight.

Set(Integer iValue)
piColumnPushedGradientColorDark
The "Dark" color in the color gradient used for the background color of "pushed" column headers. See ReportPaintManager.ColumnPushedGradientColorDark.

Set(Integer iValue)
piColumnPushedGradientColorLight
The "Light" color in the color gradient used for the background color of "pushed" column headers. See ReportPaintManager.ColumnPushedGradientColorLight.

Set(Integer iValue)
piHeaderHeightMultiplier
Determines the height of the report header section in lines of text. See ReportFormulaMulDivC.Multiplier.
If this value = -1 or 0 then it is ignored and the header height is one text line by default,
unless one of the grid columns has pbMultiLine set to True in which case the header height
is determined by the tallest column header.

Set(Integer iValue)
piFreezeColsDividerColor
Color of the freeze column divider. See ReportPaintManager.FreezeColsDividerColor.

Set(Integer iValue)
piFreezeColumnsCount
Gets\Sets the Number of columns that are frozen when the report is scrolled horizontally., see ReportControl.FreezeColumnsCount

Set(Integer iValue)
piGridLineColor
The color used to draw grid lines. See ReportPaintManager.GridLineColor.

Set(Integer iValue)
piHighlightBackColor
The background color of selected rows. See ReportPaintManager.HighlightBackColor.

Set(Integer iValue)
piHighlightForeColor
The text color of selected rows. See ReportPaintManager.HighlightForeColor.

Set(Integer iValue)
piSelectedRowBackColor
The background color of selected rows when grid doees not have the focus. See ReportPaintManager.SelectedRowBackColor.

Set(Integer iValue)
piSelectedRowForeColor
The text color of selected rows when grid does not have the focus. See ReportPaintManager.SelectedRowForeColor.

Set(Integer iValue)
piHotDividerColor
Gets\sets the color of the arrows used to Show where a column can be dropped when dragging a column header. See ReportPaintManager.HotDividerColor.

Set(Integer iValue)
piHScrollStep
Gets\sets the amount of pixels the report is scrolled when the horizontal scroll bar buttons are clicked., see ReportControl.HScrollStep

Set(Integer iValue)
piTooltipBkColor
Gets\sets the background color of the tool tip window. See TooltipContext.TipBkColor

Set(Integer iValue)
piTooltipMaxWidth
The MaxTipWidth Property gets\sets the maximum tool tip width in pixels. See TooltipContext.MaxTipWidth.

Set(Integer iValue)
piTooltipTextColor
Gets\sets the color of the text that is displayed in the tool tip window. See TooltipContext.TipTextColor.

Set(String sValue)
psNoFieldsAvailableText
The "No Fields Available" text message displayed in the Field Chooser when no Column Headers are present. See ReportPaintManager.NoFieldsAvailableText.

Set(String sValue)
psNoItemsText
The "No Items" text message displayed in the ReportControl when there are no visible rows. See ReportPaintManager.NoItemsText.

Set(Integer iValue)
TextColor:
The foreground\text color of the grid, see ReportPaintManager.ForeColor

Set(Integer iValue)
piShadeSortColor:

Set(Boolean bValue)
pbShadeSortColumn:

Set(XTPReportDrawSortTriangleStyle eStyle)
peDrawSortTriangleStyle:

Set(Integer i1 Integer i2)
Dynamic_Colors
We need to kill this procedure, else the procedures
Set Color and Set TextColor wont work. (Internal VDF behaviour).

Set(Integer iPosition)

Set(Integer iHeight Integer iWidth)
augmented to remove the custom edit before a resize.

Set(Integer iRowPos Integer iColPos)
augmented to remove the custom edit before a relocate.

Set(Integer iValue)

Set(Boolean bAsc)

Set(Integer iItem String sVal)
required Item interface

Set(Integer iItem Integer bChanged)
required Item interface
does nothing with this value

SetIndexesForSelectedRows(Integer[] SelectedRowIndexes)
Get array of selected rows. This is not to be confused with
with the Grid's SelectedRow. These are rows that are selected

SetSelectedRow(Integer iIndex Boolean bSet)
sets the selected row in report control. note this is all COM
and the selected rows do not interact with the datasource

SetSelectedRowsAll(Boolean bSet)
clear or set all rows selection

SetTooltipMargin(Integer iLeft Integer iTop Integer iRight Integer iBottom)
SetTooltipMargin
sets the top, left, bottom, and right margins of the tool tip window. This is the "padding" that is placed around
the tool tip text in the tool tip window.

SetWatermark(String sImage Integer iTransparency)
SetWatermark
Sets a watermark bitmap to be shown in the report control background using a bitmap from file or resource.
sImage - Is the resource image name or the image filename.
iTransparency - Level of transparency. Values can be 0-255 with 0 being totally transparent and 255 being totally visible.
Boolean
ShouldCommitOnObjectExit(Handle hoDestination)
called when you are exiting object. Return true if the selected row should be
committed - either saved or cleared depending on the autosave state. We pass the
destination object so you can use this to determine where you are exiting to. Sometimes
this will influence the decision.

SortGridByColumn(Handle hoCol Boolean bDescending)
request a grid datasource for passed column object and ascending/descending flag.
Should mainly be used with a datasource that is fully loaded and static.
If your datasource is cached and not fully loaded it will sort what is there which is
almost never what you.

StoreOriginalLayout()
Stores the current state as the original layout

Switch()
make sure the edit control is closed before the change

Switch_Back()
make sure the edit control is closed before the change

SynchronizeGridtoSelectedColumn()
synchronize the grid to the selected column
no row/column changing events are triggered by this
currently this is private because I cannot think of any reason this
would be used.

SynchronizeGridtoSelectedRow(Integer iRowOffsetPreference)
synchronize the grid to the selected row passing a rowOffset preference
no rowchanging events are triggered by this. The offset preference can
be a row offset or ropTop, ropCenter, ropBotton
Integer
TextColor()

ToggleEdit()
ToggleEdit
If we are editing a cell then Enter acts just like pressing Tab. If we are not editing then
Enter will put the cell into Edit mode.

UnlockBeginEdit()
Handle
ValidateRow(Boolean bTakeFocus)
Validates the selected row (which is done by the datasource). Returns column object
of the object that failed validation. If 0, no errors. If bTakeFocus is true it will
give focus to the offending column.
String
Value(Integer iItem)
required Item interface
Integer
Verify_Data_Loss()
called to verify a dataloss from a clear or restore. Return non zero to cancel
Integer
Verify_Delete()
called to verify a delete. Return non zero to cancel
Integer
Verify_Save()
called to verify a save. Return non zero to cancel

Zoom()
Does a Zoom for selected column. Needed by the rest of the system
Handle
Zoom_Object()
returns Zoom object for selected column. Needed by the rest of the system
References (1):